マルチスレッドのプログラミング

mutex の型属性の取得

pthread_mutexattr_gettype(3C) は、pthread_mutexattr_settype() によって設定された mutex の型 (type) 属性を取得します。

pthread_mutexattr_gettype の構文

#include <pthread.h>

int pthread_mutexattr_gettype(pthread_mutexattr_t  *restrict attr , 
int  *restrict type);

型 (type) 属性のデフォルト値は PTHREAD_MUTEX_DEFAULT です。

型 (type) 引数は mutex の型を指定します。有効な mutex 型を以下に示します。

それぞれの型については、pthread_mutexattr_settype の構文」を参照してください。

pthread_mutexattr_gettype の戻り値

pthread_mutexattr_gettype() は、正常終了時に 0 を返します。それ以外の戻り値は、エラーが発生したことを示します。


EINVAL

説明:

type で指定された値が無効です。