miner: set thread name before logging

This commit is contained in:
moneromooo-monero 2017-08-12 09:07:40 +01:00
parent 181a008aa3
commit d1f204d640
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -412,8 +412,8 @@ namespace cryptonote
bool miner::worker_thread()
{
uint32_t th_local_index = boost::interprocess::ipcdetail::atomic_inc32(&m_thread_index);
MGINFO("Miner thread was started ["<< th_local_index << "]");
MLOG_SET_THREAD_NAME(std::string("[miner ") + std::to_string(th_local_index) + "]");
MGINFO("Miner thread was started ["<< th_local_index << "]");
uint32_t nonce = m_starter_nonce + th_local_index;
uint64_t height = 0;
difficulty_type local_diff = 0;