diff --git a/src/context/switch.rs b/src/context/switch.rs index f92b62d874..682740196a 100644 --- a/src/context/switch.rs +++ b/src/context/switch.rs @@ -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); }