tail head cat sleep
QR code linking to this page

manページ  — PTHREAD_COND_INIT

名称

pthread_cond_init – 条件変数の作成

内容

ライブラリ

Reentrant C\~Library (libc_r, -lc_r)

書式

#include <pthread.h>

int
pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);

解説

pthread_cond_init() 関数は、 attr に指定された属性で新しい条件変数を作成します。 attr が NULL の場合には、デフォルトの属性が使用されます。

戻り値

問題がない場合は、 pthread_cond_init() 関数は 0 を返し、 cond に新しい条件変数の ID を入れます。 問題がある場合は、そのエラーを示すためにエラー番号が返されます。

エラー

pthread_cond_init() は以下の場合に失敗します。
[EINVAL]
  attr によって指定された値が無効です。
[ENOMEM]
  プロセスが別の条件変数の作成のための十分なメモリを割り当てられません。
[EAGAIN]
  別の条件変数を作成するために一時的なリソースが不足しています。

関連項目

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

規格

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

PTHREAD_COND_INIT (3) July 28, 1998

tail head cat sleep
QR code linking to this page


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

Never write it in C if you can do it in `awk';
Never do it in `awk' if `sed' can handle it;
Never use `sed' when `tr' can do the job;
Never invoke `tr' when `cat' is sufficient;
Avoid using `cat' whenever possible.
— Taylor's Laws of Programming