mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Minor style change
This commit is contained in:
+2
-4
@@ -61,9 +61,7 @@ void thread_pool_queue_push(Thread *thread, WorkerTask task) {
|
|||||||
u64 tail = ((u32)capture) & mask;
|
u64 tail = ((u32)capture) & mask;
|
||||||
|
|
||||||
u64 new_head = (head + 1) & mask;
|
u64 new_head = (head + 1) & mask;
|
||||||
if (new_head == tail) {
|
GB_ASSERT_MSG(new_head != tail, "Thread Queue Full!");
|
||||||
GB_PANIC("Thread Queue Full!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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
|
// 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;
|
thread->queue[head] = task;
|
||||||
@@ -139,7 +137,7 @@ gb_internal THREAD_PROC(thread_pool_thread_proc) {
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
work_start:
|
work_start:
|
||||||
if (!pool->running) {
|
if (!pool->running.load()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -193,10 +193,6 @@ gb_internal void semaphore_wait(Semaphore *s) {
|
|||||||
CONDITION_VARIABLE cond;
|
CONDITION_VARIABLE cond;
|
||||||
};
|
};
|
||||||
|
|
||||||
gb_internal void condition_init(Condition *c) {
|
|
||||||
}
|
|
||||||
gb_internal void condition_destroy(Condition *c) {
|
|
||||||
}
|
|
||||||
gb_internal void condition_broadcast(Condition *c) {
|
gb_internal void condition_broadcast(Condition *c) {
|
||||||
WakeAllConditionVariable(&c->cond);
|
WakeAllConditionVariable(&c->cond);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user