tail head cat sleep
QR code linking to this page

manページ  — PTHREAD_COND_WAIT

名称

pthread_cond_wait – 条件変数の待機

内容

ライブラリ

Reentrant C\~Library (libc_r, -lc_r)

書式

#include <pthread.h>

int
pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);

解説

pthread_cond_wait() 関数は、 cond で指定された条件変数で待っている現在のスレッドを不可分にブロックし、 mutex で指定された mutex のブロックを解除します。 待っているスレッドは、別のスレッドが pthread_cond_signal(3) または pthread_cond_broadcast(3) を同じ条件変数で呼び出した後にのみブロックが解除され、現在のスレッドは mutex のロックを再取得します。

戻り値

問題がない場合は、 pthread_cond_wait() 関数は 0 を返します。 問題がある場合は、そのエラーを示すためにエラー番号が返されます。

エラー

pthread_cond_wait() は以下の場合に失敗します。
[EINVAL]
  cond によって指定された値、または mutex によって指定された値が無効です。

関連項目

pthread_cond_broadcast(3), pthread_cond_destroy(3), pthread_cond_init(3), pthread_cond_signal(3), pthread_cond_timedwait(3)

規格

pthread_cond_wait()IEEE Std 1003.1-96 ("POSIX.1") に適合しています。

PTHREAD_COND_WAIT (3) July 28, 1998

tail head cat sleep
QR code linking to this page


このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.

One of the advantages of using UNIX to teach an operating systems course is the sources and documentation will easily fit into a student's briefcase.
— John Lions