Skip to main content

timer_tick

Function timer_tick 

Source
pub fn timer_tick()
Expand description

Timer interrupt handler - called from interrupt context.

Increments the global tick counter unconditionally on BSP so wall-clock time never drifts even when the scheduler lock is contended. Secondary bookkeeping (interval timers, wake deadlines, per-task accounting) is deferred when the lock is unavailable.

Lock discipline: tick_all_timers and check_wake_deadlines each acquire the scheduler lock themselves via try_lock. The per-task block below uses its own try_lock. These are separate acquisitions by design - the inner functions must not be called while the outer lock is held (that would deadlock).