From e8b5f42e7520c74077db2cc11904a19b7ab14a73 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Fri, 12 Mar 2021 17:33:54 +0200 Subject: [PATCH] ConcurrentQueue::nextJob: notify all _waitVar threads Replace _waitVar.notify_one() with _waitVar.notify_all(). This was the only hurdle to documenting ConcurrentQueue::waitAll() as thread-safe. ConcurrentQueueTest::waitAllFromMultipleThreads() passes instead of hanging now. --- common/concurrent_queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/concurrent_queue.h b/common/concurrent_queue.h index d7031dbf..0d8384fa 100644 --- a/common/concurrent_queue.h +++ b/common/concurrent_queue.h @@ -113,7 +113,7 @@ private: --jobsLeft; } - _waitVar.notify_one(); + _waitVar.notify_all(); } }