Workaround for crashes on shutdown

This commit is contained in:
SChernykh 2021-08-23 22:50:36 +02:00
parent c4d3f6f8b4
commit 656f912a3e

View file

@ -685,6 +685,14 @@ int p2pool::run()
m_stopped = true; 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_stratumServer;
delete m_p2pServer; delete m_p2pServer;