Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Relax timeout for thread waiting to not be so aggressive.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbutrovich committed Jul 2, 2018
1 parent 2828d80 commit 8af1727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/threadpool/worker_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void WorkerFunc(std::string thread_name, std::atomic_bool *is_running,

while (is_running->load() || !task_queue->IsEmpty()) {
std::unique_lock<std::mutex> lock(*cv_lock);
not_empty->wait_for(lock, std::chrono::milliseconds(1),
not_empty->wait_for(lock, std::chrono::seconds(1),
[&] { return !task_queue->IsEmpty(); });
std::function<void()> task;
if (task_queue->Dequeue(task)) {
Expand Down

0 comments on commit 8af1727

Please sign in to comment.