Workaround for crashes on shutdown

pull/5/head
SChernykh 2021-08-23 22:50:36 +02:00
parent c4d3f6f8b4
commit 656f912a3e
1 changed files with 8 additions and 0 deletions

View File

@ -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;