Skip to main content

compute_postpone_state

Function compute_postpone_state 

Source
async fn compute_postpone_state(
    settings: &Mutex<Settings>,
    timers: &Mutex<BreakTimers>,
    kind: BreakKind,
) -> PostponeState
Expand description

Lock-then-snapshot helper: settings first (cloned and released), then timers (read and released). Never holds two scheduler mutex guards across an .await, so two concurrent callers can’t deadlock even if the rest of the codebase locks them in the opposite order.