... 信号量 Semaphores and threads 条件变量与线程 Condition variable and threads 线程的同步单元 Threads as synchronization primitives ...
基于1个网页-相关网页
Therefore, at the end of it all, you now have two reader threads, both waiting on the condition variable, and the mutex is unlocked.
因此,最后两个读线程都等待条件变量,互斥锁没有被锁住。
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的读线程;读线程现在隐式地争夺互斥锁。
应用推荐