From e878a2c96f1849f14f05d9a09d59d11d63bf892b Mon Sep 17 00:00:00 2001 From: jacob Date: Wed, 9 Jul 2025 14:43:51 -0500 Subject: [PATCH] formatting --- src/sys_win32.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sys_win32.c b/src/sys_win32.c index d125063b..b274e662 100644 --- a/src/sys_win32.c +++ b/src/sys_win32.c @@ -403,7 +403,7 @@ void sys_wake_all(void *addr) struct arena_temp scratch = scratch_begin_no_conflict(); { /* Separate waiters by queue kind */ - i32 queue_counts[NUM_JOB_QUEUE_KINDS] = ZI; + i32 queue_waiter_counts[NUM_JOB_QUEUE_KINDS] = ZI; struct fiber **queue_waiter_arrays[NUM_JOB_QUEUE_KINDS] = ZI; for (i32 i = 0; i < (i32)countof(queue_waiter_arrays); ++i) { /* NOTE: Each array is conservatively sized as the number of all waiters in the list */ @@ -411,20 +411,20 @@ void sys_wake_all(void *addr) } for (struct fiber *waiter = fiber_from_id(wait_list->first_waiter); waiter; waiter = fiber_from_id(waiter->next_addr_waiter)) { enum job_queue_kind queue_kind = job_queue_kind_from_priority(waiter->job_priority); - i32 index = queue_counts[queue_kind]++; + i32 index = queue_waiter_counts[queue_kind]++; struct fiber **array = queue_waiter_arrays[queue_kind]; array[index] = waiter; } /* Push jobs */ - for (i32 queue_kind = 0; queue_kind < (i32)countof(queue_counts); ++queue_kind) { - i32 num_jobs = queue_counts[queue_kind]; - if (num_jobs > 0) { + for (i32 queue_kind = 0; queue_kind < (i32)countof(queue_waiter_counts); ++queue_kind) { + i32 queue_num_waiters = queue_waiter_counts[queue_kind]; + if (queue_num_waiters > 0) { struct job_queue *queue = &G.job_queues[queue_kind]; struct fiber **queue_waiters = queue_waiter_arrays[queue_kind]; while (atomic_i32_fetch_test_set(&queue->lock, 0, 1) != 0) ix_pause(); { /* TODO: More efficient batch job list allocation */ - for (i32 i = 0; i < num_jobs; ++i) { + for (i32 i = 0; i < queue_num_waiters; ++i) { struct fiber *waiter = queue_waiters[i]; struct job_info *info = NULL; if (queue->first_free) {