mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-30 06:48:22 +00:00
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:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user