tail head cat sleep
QR code linking to this page

manページ  — PTHREAD_MUTEX_TRYLOCK

名称

pthread_mutex_trylock – ブロックを伴わない mutex のロックの試行

内容

ライブラリ

Reentrant C\~Library (libc_r, -lc_r)

書式

#include <pthread.h>

int
pthread_mutex_trylock(pthread_mutex_t *mutex);

解説

pthread_mutex_trylock() 関数は mutex をロックします。 mutex が既にロックされている場合には、 pthread_mutex_trylock() はその mutex を待つためにブロックせずに、エラー条件を返します。

戻り値

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

エラー

pthread_mutex_trylock() は以下の場合に失敗します。
[EINVAL]
  mutex によって指定された値が無効です。
[EBUSY]
  mutex が既にロックされています。

関連項目

pthread_mutex_destroy(3), pthread_mutex_init(3), pthread_mutex_lock(3), pthread_mutex_unlock(3)

規格

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

PTHREAD_MUTEX_TRYLOCK (3) July 30, 1998

tail head cat sleep
QR code linking to this page


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

“ Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. ”
— The Unix Haters' handbook