mirror of
https://github.com/YACReader/yacreader
synced 2025-07-17 20:44:32 -04:00
Make ConcurrentQueue::waitAll() const
This member function does not affect the logical state of the class. Making std::condition_variable and std::mutex data members mutable is idiomatic as these classes are thread-safe synchronization primitives.
This commit is contained in:
committed by
Luis Ángel San Martín
parent
72c78d0164
commit
05b384ed6d
@ -59,7 +59,7 @@ std::size_t ConcurrentQueue::cancelPending()
|
||||
return size;
|
||||
}
|
||||
|
||||
void ConcurrentQueue::waitAll()
|
||||
void ConcurrentQueue::waitAll() const
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(jobsLeftMutex);
|
||||
_waitVar.wait(lock, [this] { return jobsLeft == 0; });
|
||||
|
Reference in New Issue
Block a user