Skip to content

Commit 5dade0e

Browse files
committed
WorkerThreadPool: Fix end-of-yield logic potentially leading to deadlocks
1 parent 108c603 commit 5dade0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/object/worker_thread_pool.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,10 @@ void WorkerThreadPool::_wait_collaboratively(ThreadData *p_caller_pool_thread, T
461461
p_caller_pool_thread->signaled = false;
462462

463463
if (IS_WAIT_OVER) {
464-
p_caller_pool_thread->yield_is_over = false;
464+
if (unlikely(p_task == ThreadData::YIELDING)) {
465+
p_caller_pool_thread->yield_is_over = false;
466+
}
467+
465468
if (!exit_threads && was_signaled) {
466469
// This thread was awaken for some additional reason, but it's about to exit.
467470
// Let's find out what may be pending and forward the requests.

0 commit comments

Comments
 (0)