名前空間
変種
操作

cnd_wait

提供: cppreference.com
< c‎ | thread

 
 
スレッドのサポートライブラリ
スレッド
Original:
Threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
相互排除
Original:
Mutual exclusion
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
一度呼び出します
Original:
Call once
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
条件変数
Original:
Condition variables
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
スレッドローカルストレージ
Original:
Thread-local storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Defined in header <threads.h>
int cnd_wait( cnd_t* cond, mtx_t* mutex );
(C11以来)
スレッドがmutexまたはcondにより信号が送信されるまでアトミックcnd_signalが指す条件変数でcnd_broadcastとブロックが指すmutexをロックします。ミューテックス関数が戻る前に再びロックされている.
Original:
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 text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mutexは既に呼び出しスレッドによってロックされていない場合の動作は未定義です.
Original:
The behavior is undefined if the mutex is not already locked by the calling thread.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] パラメータ

cond -
をブロックするために、条件変数へのポインタ
Original:
pointer to the condition variable to block on
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mutex -
ブロックの持続時間のためにロックを解除するmutexへのポインタ
Original:
pointer to the mutex to unlock for the duration of the block
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

thrd_success成功した場合、thrd_errorその他のとき.
Original:
thrd_success if successful, thrd_error otherwise.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] も参照してください

タイムアウト付き条件変数でブロック
Original:
blocks on a condition variable, with a timeout
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(機能) [edit]