From bdb9acc0fee9e727b18d946dfc245a8229dca034 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 20 Feb 2022 10:33:13 -0500 Subject: [PATCH] Release lock before notify --- src/zm_db.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/zm_db.cpp b/src/zm_db.cpp index 7db61e157..b5ec9d514 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -237,8 +237,12 @@ zmDbQueue::~zmDbQueue() { } void zmDbQueue::stop() { - mTerminate = true; + { + std::unique_lock lock(mMutex); + mTerminate = true; + } mCondition.notify_all(); + if (mThread.joinable()) mThread.join(); }