Release lock before notify

This commit is contained in:
Isaac Connor 2022-02-20 10:33:13 -05:00
parent 484827bdeb
commit bdb9acc0fe
1 changed files with 5 additions and 1 deletions

View File

@ -237,8 +237,12 @@ zmDbQueue::~zmDbQueue() {
} }
void zmDbQueue::stop() { void zmDbQueue::stop() {
{
std::unique_lock<std::mutex> lock(mMutex);
mTerminate = true; mTerminate = true;
}
mCondition.notify_all(); mCondition.notify_all();
if (mThread.joinable()) mThread.join(); if (mThread.joinable()) mThread.join();
} }