* 'queue_lock' of https://github.com/MaxKellermann/zeek:
  threading/Queue: lock mutex before notifying the condition_variable
This commit is contained in:
Jon Siwek 2020-02-28 11:36:12 -08:00
commit 30a794cf5f
3 changed files with 10 additions and 1 deletions

View file

@ -255,7 +255,10 @@ template<typename T>
inline void Queue<T>::WakeUp()
{
for ( int i = 0; i < NUM_QUEUES; i++ )
{
auto lock = acquire_lock(mutex[i]);
has_data[i].notify_all();
}
}
}