[Recorded] a problem using c ++ condition_variable question 11 more under ndk

1. presence notification missing: the producer thread notification 196 times, 190 times consumers receive the thread, resulting in some data can not be processed.
After locking 2.cond.wait () method has the problem, resulting in an empty queue and dequeue operations coredump. I will always remember after regaining lock wait () is!

Yet to find the reason, in rotation with + sleep instead of awkward condition variable.

Guess you like

Origin www.cnblogs.com/ahfuzhang/p/11440089.html