|
|
|
|
|
by usefulcat
2352 days ago
|
|
In this case I think it should be ok because !this->tasks.empty() is part of the predicate, and will be true after a new item is enqueued (and before notify is called). So if the producer is interrupted between releasing the mutex and calling notify, the consumer would not call wait. But yeah, in general I agree with the advice.. I'm pretty sure I've made that mistake before. |
|