From: Razvan Becheriu Date: Thu, 21 Nov 2019 13:25:57 +0000 (+0200) Subject: [#883, !506] must use mutex when changing state of predicate component X-Git-Tag: Kea-1.7.2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a09d21c224452cb97cebc22980a2e2c4ebb1b388;p=thirdparty%2Fkea.git [#883, !506] must use mutex when changing state of predicate component --- diff --git a/src/lib/util/thread_pool.h b/src/lib/util/thread_pool.h index 946958dcbd..87727f0efd 100644 --- a/src/lib/util/thread_pool.h +++ b/src/lib/util/thread_pool.h @@ -207,6 +207,7 @@ private: /// /// Sets the queue state to 'enabled' void enable() { + std::lock_guard lock(mutex_); enabled_ = true; } @@ -214,7 +215,10 @@ private: /// /// Sets the queue state to 'disabled' void disable() { - enabled_ = false; + { + std::lock_guard lock(mutex_); + enabled_ = false; + } // Notify pop so that it can exit. cv_.notify_all(); }