mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Don't join thread in CQuorum::~CQuorum when called from within the thread (#3223)
This commit is contained in:
parent
e69c6c3207
commit
2fef21fd80
@ -44,7 +44,9 @@ CQuorum::~CQuorum()
|
||||
{
|
||||
// most likely the thread is already done
|
||||
stopCachePopulatorThread = true;
|
||||
if (cachePopulatorThread.joinable()) {
|
||||
// watch out to not join the thread when we're called from inside the thread, which might happen on shutdown. This
|
||||
// is because on shutdown the thread is the last owner of the shared CQuorum instance and thus the destroyer of it.
|
||||
if (cachePopulatorThread.joinable() && cachePopulatorThread.get_id() != std::this_thread::get_id()) {
|
||||
cachePopulatorThread.join();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user