Fix minor possible race condition

This commit is contained in:
gingerBill
2023-01-16 18:18:08 +00:00
parent 0d059aa797
commit 0b01cfd853
2 changed files with 7 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ gb_global ThreadPool global_thread_pool;
gb_internal void init_global_thread_pool(void) {
isize thread_count = gb_max(build_context.thread_count, 1);
isize worker_count = thread_count; // +1
thread_pool_init(&global_thread_pool, permanent_allocator(), worker_count, "ThreadPoolWorker");
thread_pool_init(&global_thread_pool, worker_count, "ThreadPoolWorker");
}
gb_internal bool thread_pool_add_task(WorkerTaskProc *proc, void *data) {
return thread_pool_add_task(&global_thread_pool, proc, data);