Stopping C++ 11 std::threads waiting on a std::condition_variable
问题 I am trying to understand the basic multithreading mechanisms in the new C++ 11 standard. The most basic example I can think of is the following: A producer and a consumer are implemented in separate threads The producer places a certain amount of items inside a queue The consumer takes items from the queue if there are any present This example is also used in many school books about multithreading and everything about the communication process works fine. However, I have a problem when it