I noticed that the example in the manual only signal other threads when the queue was empty (before we push). I'm not sure how it matters to avoid unnecessary Condition.sginal, but it seems sensible to me since we only wait when the queue is empty anyway.
I noticed that the example in the manual only
signal
other threads when the queue was empty (before wepush
). I'm not sure how it matters to avoid unnecessaryCondition.sginal
, but it seems sensible to me since we onlywait
when the queue is empty anyway.