From da479c7628d827d4343f82954c7d09adff31876c Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 2 Jan 2023 00:35:12 +0000 Subject: [PATCH] Minor style change --- src/thread_pool.cpp | 6 ++---- src/threading.cpp | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index 768a92645..9ac1af039 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -61,9 +61,7 @@ void thread_pool_queue_push(Thread *thread, WorkerTask task) { u64 tail = ((u32)capture) & mask; u64 new_head = (head + 1) & mask; - if (new_head == tail) { - GB_PANIC("Thread Queue Full!\n"); - } + GB_ASSERT_MSG(new_head != tail, "Thread Queue Full!"); // This *must* be done in here, to avoid a potential race condition where we no longer own the slot by the time we're assigning thread->queue[head] = task; @@ -139,7 +137,7 @@ gb_internal THREAD_PROC(thread_pool_thread_proc) { for (;;) { work_start: - if (!pool->running) { + if (!pool->running.load()) { break; } diff --git a/src/threading.cpp b/src/threading.cpp index e3f26a8a0..4c7aa8f92 100644 --- a/src/threading.cpp +++ b/src/threading.cpp @@ -193,10 +193,6 @@ gb_internal void semaphore_wait(Semaphore *s) { CONDITION_VARIABLE cond; }; - gb_internal void condition_init(Condition *c) { - } - gb_internal void condition_destroy(Condition *c) { - } gb_internal void condition_broadcast(Condition *c) { WakeAllConditionVariable(&c->cond); }