Potential lost wakeup in condition variables
Closed this issue · 0 comments
j-piecuch commented
cv_wait
and cv_wait_timed
are supposed to atomically release a lock and go to sleep:
Lines 27 to 34 in 4336f9a
Preemption is disabled between unlocking and going to sleep, but we might get an interrupt. Some interrupt filter routines call
cv_signal
(e.g. atkbdc_intr
), so there is a potential lost wakeup.One solution would be to use
WITH_INTR_DISABLED
instead of WITH_NO_PREEMPTION
.