第二个读线程经历同样的过程。
对于阻塞队列,只有读线程需要在队列中没有数据时等待。
In a blocking queue, only the reader thread needs to wait when there is no data in the queue.
因此,最后两个读线程都等待条件变量,互斥锁没有被锁住。
Therefore, at the end of it all, you now have two reader threads, both waiting on the condition variable, and the mutex is unlocked.
应用推荐