ke,ex: rework kernel queue

There was previously a lock inversion in the queue code where we acquired the
queue lock under the thread lock (in the wait_any committing path). This patch
attempts to fix this by instead using an atomic count and deferring the waking
of other threads to a DPC.
This commit is contained in:
Loïc Grégoire
2026-10-10 09:37:43 -04:00
parent ad7f14ecb8
commit c55beec893
3 changed files with 50 additions and 22 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ const Pool = struct {
.monotonic,
) == &self.queue.items.head;
const active = @atomicLoad(usize, &self.queue.active, .monotonic);
const active = self.queue.active.load(.monotonic);
const threads = self.total_threads.load(.monotonic);
if (threads < max_threads_for_prio(self.prio) and !is_empty and