Why does `notify_one_slow` return true even if threads were only requeued, and not unparked?
bzm3r opened this issue · comments
Brian Merchant commented
This is a conceptual question.
In notify_one_slow
on Condvar
, we have:
Line 174 in 4adcfdd
Suppose res.unparked_threads == 0
, but res.requeued_threads > 0
, then should notify_one_slow
return true?
Amanieu d'Antras commented
notify_one
returns true if a thread was waiting on the condvar and has now been woken up. It doesn't matter whether this was done by waking it up directly or requeuing it to the mutex so that it will be woken up when the mutex is unlocked.
Brian Merchant commented
@Amanieu Thank you, that makes sense!