mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 01:42:27 +00:00
miner: minor fixes on stop
- only try to stop if actually started - print number of threads before zeroing it This fixes the suspiciously doubled "Mining has been stopped" message on exit.
This commit is contained in:
parent
b245215193
commit
ed5d017c0f
1 changed files with 4 additions and 1 deletions
|
@ -278,14 +278,17 @@ namespace cryptonote
|
||||||
//-----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------
|
||||||
bool miner::stop()
|
bool miner::stop()
|
||||||
{
|
{
|
||||||
|
if (!is_mining())
|
||||||
|
return true;
|
||||||
|
|
||||||
send_stop_signal();
|
send_stop_signal();
|
||||||
CRITICAL_REGION_LOCAL(m_threads_lock);
|
CRITICAL_REGION_LOCAL(m_threads_lock);
|
||||||
|
|
||||||
BOOST_FOREACH(boost::thread& th, m_threads)
|
BOOST_FOREACH(boost::thread& th, m_threads)
|
||||||
th.join();
|
th.join();
|
||||||
|
|
||||||
m_threads.clear();
|
|
||||||
LOG_PRINT_L0("Mining has been stopped, " << m_threads.size() << " finished" );
|
LOG_PRINT_L0("Mining has been stopped, " << m_threads.size() << " finished" );
|
||||||
|
m_threads.clear();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue