Fix deadlock on contended switch

This commit is contained in:
Wildan M
2026-04-29 11:21:02 +07:00
parent fd5a04a121
commit e7ac009f31
+1 -1
View File
@@ -96,7 +96,7 @@ pub fn tick(token: &mut CleanLockToken) {
ticks_cell.set(new_ticks);
// Trigger a context switch after every 3 ticks (approx. 6.75 ms).
if new_ticks >= 3 {
if new_ticks >= 3 && arch::CONTEXT_SWITCH_LOCK.load(Ordering::Relaxed) == false {
switch(token);
crate::context::signal::signal_handler(token);
}