aboutsummaryrefslogtreecommitdiff
path: root/src/thread_pool.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-26 22:17:51 +0100
committergingerBill <bill@gingerbill.org>2021-08-26 22:17:51 +0100
commitb33bf3f7042464ac4f6e187fc487ee42668fcef7 (patch)
treea60151734e843e3efd542267eff16fe071fdb432 /src/thread_pool.cpp
parent726788a48310971b0df8f431968100786d2f8cab (diff)
Correct race condition and incorrect usage of `condition_signal` outside of a mutex lock
Diffstat (limited to 'src/thread_pool.cpp')
-rw-r--r--src/thread_pool.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}