diff --git a/cpp/task_queue.cpp b/cpp/task_queue.cpp index abdc9b2..1c4260f 100644 --- a/cpp/task_queue.cpp +++ b/cpp/task_queue.cpp @@ -89,10 +89,7 @@ void TaskQueue::worker_thread() { std::shared_ptr task_to_execute; { std::lock_guard tasks_lock(tasks_mutex_); - - if (stop_ && tasks_.empty()) { - return; // Exit thread if stopping and no tasks left - } + if (stop_ && tasks_.empty()) return; auto it = tasks_.begin(); bool found_valid = false;