From b33bf3f7042464ac4f6e187fc487ee42668fcef7 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 26 Aug 2021 22:17:51 +0100 Subject: Correct race condition and incorrect usage of `condition_signal` outside of a mutex lock --- src/thread_pool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/thread_pool.cpp') diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index a8bc327e5..ed3a065e0 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -93,8 +93,8 @@ bool thread_pool_add_task(ThreadPool *pool, WorkerTaskProc *proc, void *data) { thread_pool_queue_push(pool, task); GB_ASSERT(pool->ready >= 0); pool->ready++; - mutex_unlock(&pool->mutex); condition_signal(&pool->task_cond); + mutex_unlock(&pool->mutex); return true; } -- cgit v1.2.3