cnd_wait
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <threads.h> 中定义
|
||
(C11 起) | ||
mutex
和块指向的互斥锁,原子锁,直到该线程指向的条件变量的cond
信号cnd_signal或cnd_broadcast。在函数返回前被再次锁定互斥锁.原文:
Atomically locks the mutex pointed to by
mutex
and blocks on the condition variable pointed to by cond
until the thread is signalled by cnd_signal or cnd_broadcast. The mutex is locked again before the function returns.如果互斥已经锁定由调用线程的行为是未定义的.
原文:
The behavior is undefined if the mutex is not already locked by the calling thread.
[编辑] 参数
cond | - | 指针指向的条件变量来阻止
原文: pointer to the condition variable to block on |
mutex | - | 指针的互斥锁解锁的块的持续时间
原文: pointer to the mutex to unlock for the duration of the block |
[编辑] 返回值
[编辑] 另请参阅
(C11) |
在一个条件变量,超时块 原文: blocks on a condition variable, with a timeout (函数) |