diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-26 22:17:51 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-26 22:17:51 +0100 |
| commit | b33bf3f7042464ac4f6e187fc487ee42668fcef7 (patch) | |
| tree | a60151734e843e3efd542267eff16fe071fdb432 /src/thread_pool.cpp | |
| parent | 726788a48310971b0df8f431968100786d2f8cab (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.cpp | 2 |
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; } |