Instead of throwing an exception when the queue is empty, the reader thread now blocks itself on the condition variable.
当队列是空的时候,读线程现在并不抛出异常,而是在条件变量上阻塞自身。
If the queue is full, the writer thread waits on the _wcond condition variable; the reader thread will need a notification to all threads after consuming data from the queue.
如果队列满了,写线程等待_ wcond条件变量;读线程在从队列中取出数据之后需要通知所有线程。
If another thread calls pthread_cond_signal on a condition, then a thread that was waiting on that condition variable is woken up.
如果另一个线程对一个条件变量调用pthread_cond_signal,那么那个等待这个条件而被阻塞的线程就会被唤醒。
If another thread calls pthread_cond_broadcast on a condition, then all threads waiting on that variable are woken up.
如果另一个线程对这个条件变量调用pthread_cond_broadcast,那么所有等待这个条件而被阻塞的线程都会被唤醒。
Next, the reader thread needs to ensure (and this is the second check you perform) that it does not wait on the condition variable any more than the specified timeout period.
接下来,读线程需要确保(这是第二个检查)它等待条件变量的时间不超过指定的超时时间。
Therefore, at the end of it all, you now have two reader threads, both waiting on the condition variable, and the mutex is unlocked.
因此,最后两个读线程都等待条件变量,互斥锁没有被锁住。
It also allows you to unlock the mutex and wait on the condition variable atomically, without the possible intervention of another thread.
它还允许您原子地(atomically)解除互斥的锁定,并等待条件变量,而不会有干涉其他线程的可能。
Doing so awakens all the reader threads that were waiting on the condition variable _cond; the reader threads now implicitly compete for the mutex lock as and when it is released.
这么做会唤醒所有等待条件变量_ cond的读线程;读线程现在隐式地争夺互斥锁。
This paper presents the fuzzy reliability design of the helical compression spring, on condition that a fuzzy variable strength and a random stress are given.
本文对螺旋压缩型弹簧的强度为模糊变量、应力为随机变量的情况,提出了模糊可靠的设计方法,并给出了计算实例。
Based on the conservative condition of vector lines of variable field in the continuous medium, the problems of electromagnetic field in the moving system are discussed in this paper.
本文由连续介质中的可变场的矢量线的保持性条件,主要讨论了运动系统中电磁场的保持性问题。
A condition variable allows a task to wait on a synchronization primitive within a critical region.
一个条件变量允许任务等待一个同步原语,以进入临界区。
Experimental design may not only clarify influence of the independent variable on the dependent variable in the testing, but also seek its best test condition.
通过试验设计,不仅可以弄清楚试验过程中自变量对于因变量的影响的大小和趋势,还可以寻找其最佳试验条件。
The thread that activates once the counter reaches the limit would wait on the condition variable.
一旦计数器达到界限就激活的线程会等待条件变量。
The condition, which they imposed on the distribution of the regressor variable X in their construction of the estimators, is very restrictive.
但在把他们的估计中,对自变量的分布加上了很强的限制性条件。
This paper carries on the research of the variable condition property theory model for large-capacity power plant boiler.
本文针对大容量电站锅炉变工况特性进行了理论模型的研究。
Study on the characteristics of variable condition of the same cascade equipped with a cylindrical or a elliptic lacing wire is made in this paper with CFD.
本文主要运用CFD方法,在同一平面叶栅,对分别装有圆柱形和椭圆形拉金进行了多个工况下气动特性的比较。
Simultaneously, it provides the method to determine the best pressure of header system and optimum frequency of variable frequency pump based on the special working condition.
同时,给出了在特定工况下,确定最佳母管压力和变频泵最佳频率的方法。
Simultaneously, it provides the method to determine the best pressure of header system and optimum frequency of variable frequency pump based on the special working condition.
同时,给出了在特定工况下,确定最佳母管压力和变频泵最佳频率的方法。
应用推荐