mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-16 15:57:39 +00:00
Workaround for crashes on shutdown
This commit is contained in:
parent
c4d3f6f8b4
commit
656f912a3e
1 changed files with 8 additions and 0 deletions
|
@ -685,6 +685,14 @@ int p2pool::run()
|
|||
|
||||
m_stopped = true;
|
||||
|
||||
const int32_t k = num_running_jobs.load();
|
||||
if (k != 0) {
|
||||
LOGINFO(1, "waiting for " << k << " background jobs to finish");
|
||||
while (num_running_jobs != 0) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
delete m_stratumServer;
|
||||
delete m_p2pServer;
|
||||
|
||||
|
|
Loading…
Reference in a new issue