当队列是空的时候,读线程现在并不抛出异常,而是在条件变量上阻塞自身。
Instead of throwing an exception when the queue is empty, the reader thread now blocks itself on the condition variable.
有许多消息流程被分配给一个执行组,被并发地读或写的队列很可能超过30个。
There are many message flows assigned to an execution group and it is likely that there will be more than 30 queues concurrently being written or read.
第一个读线程锁住互斥锁,发现队列是空的,然后在 _cond 上阻塞自身,这会隐式地释放互斥锁。
The first reader thread locked the mutex, realized that the queue is empty, and blocked itself on _cond, which implicitly released the mutex.
应用推荐