mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
ke/sched: style fixes
This commit is contained in:
+8
-2
@@ -1318,7 +1318,12 @@ pub fn yield_locked(continuation: ?ke.Continuation) void {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (cur != next and next.?.switching.load(.monotonic) == true) {
|
if (next == cur) {
|
||||||
|
// We just selected the same thread again.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (next.?.switching.load(.monotonic) == true) {
|
||||||
std.atomic.spinLoopHint();
|
std.atomic.spinLoopHint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1369,7 +1374,8 @@ pub fn yield_locked(continuation: ?ke.Continuation) void {
|
|||||||
cur.switching.store(false, .monotonic);
|
cur.switching.store(false, .monotonic);
|
||||||
cur.lock.release_no_ipl();
|
cur.lock.release_no_ipl();
|
||||||
|
|
||||||
if (cont) |c| kep.impl.call_continuation(&cur.context, c);
|
if (cont) |c|
|
||||||
|
kep.impl.call_continuation(&cur.context, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cur lock dropped
|
// cur lock dropped
|
||||||
|
|||||||
Reference in New Issue
Block a user