aboutsummaryrefslogtreecommitdiff
path: root/src/thread_pool.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-02 00:35:12 +0000
committergingerBill <bill@gingerbill.org>2023-01-02 00:35:12 +0000
commitda479c7628d827d4343f82954c7d09adff31876c (patch)
tree7e0a4eaa8c911340ff55c983cb2c4e1368fd3336 /src/thread_pool.cpp
parent3c90a059571cb879a468a00c0ca26c9a35090c38 (diff)
Minor style change
Diffstat (limited to 'src/thread_pool.cpp')
-rw-r--r--src/thread_pool.cpp6
1 files changed, 2 insertions, 4 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;
}