Skip to content

Commit

Permalink
WorkerThreadPool: Fix end-of-yield logic potentially leading to deadl…
Browse files Browse the repository at this point in the history
…ocks
  • Loading branch information
RandomShaper committed Aug 28, 2024
1 parent 108c603 commit 5dade0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/object/worker_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,10 @@ void WorkerThreadPool::_wait_collaboratively(ThreadData *p_caller_pool_thread, T
p_caller_pool_thread->signaled = false;

if (IS_WAIT_OVER) {
p_caller_pool_thread->yield_is_over = false;
if (unlikely(p_task == ThreadData::YIELDING)) {
p_caller_pool_thread->yield_is_over = false;
}

if (!exit_threads && was_signaled) {
// This thread was awaken for some additional reason, but it's about to exit.
// Let's find out what may be pending and forward the requests.
Expand Down

0 comments on commit 5dade0e

Please sign in to comment.