Skip to content

Commit

Permalink
Predicate on should_stop_ in thread_worker_().
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Nov 17, 2023
1 parent fcb550b commit 56f0bf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ common::ThreadPool::thread_worker_()
{
TRACE("Worker thread starting.");

while (true) {
while (!should_stop_) {
std::unique_lock lock(jobs_mutex_);
cv_.wait(lock, [&] { return should_stop_ || !jobs_.empty(); });

Expand Down

0 comments on commit 56f0bf8

Please sign in to comment.