mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 23:38:21 +00:00
ke: add lock warden
This commit is contained in:
+7
-1
@@ -260,7 +260,7 @@ fn init_cpu() linksection(r.init) void {
|
||||
.status = 0,
|
||||
.queues = undefined,
|
||||
},
|
||||
.queues_lock = .init(),
|
||||
.queues_lock = .init("runq"),
|
||||
.idle_queue = undefined,
|
||||
.steal_work = false,
|
||||
.load = .init(0),
|
||||
@@ -1125,6 +1125,12 @@ fn do_switch(cpu: *PerCpu, cur: *ke.Thread, next: *ke.Thread) void {
|
||||
kep.impl.call_continuation(&next.context, continuation);
|
||||
}
|
||||
|
||||
if (config.warden) {
|
||||
// The lock will get released through the context switch assembly code,
|
||||
// start pretending we don't hold it right now.
|
||||
kep.warden.released(&cur.lock, .Spin);
|
||||
}
|
||||
|
||||
if (relinquish) {
|
||||
kep.impl.switch_cont_to_normal(&cur.context, &next.context);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user