Skip to main content

LOCK_STATE_PREV

Static LOCK_STATE_PREV 

Source
static LOCK_STATE_PREV: AtomicU8
Expand description

Encoded previous lock state for the transition logger: 0 = unknown / haven’t seen yet (the initial value) 1 = last seen as Some(false) (confidently unlocked) 2 = last seen as Some(true) (confidently locked) Option<bool> directly is what we want logically, but we need an atomic so the run-loop closure can mutate the previous-state across ticks without locking. AtomicU8 is the smallest fit.