📄 pthread_mutexattr_init.txt
字号:
pthread_mutexattr_init SubroutinePurposeCreates a mutex attributes object and initializes it with defaultvalues.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_mutexattr_init (attr)pthread_mutexattr_t *attr;DescriptionThe pthread_mutexattr_init subroutine creates a new mutex attributesobject attr. The new mutex attributes object is initialized with thefollowing default values:------------------------------------------------------------------------------------------------------------------|Initialized if _POSIX_THREAD_PRIO_INHERIT is defined ||------------------------------------------------------------|---------------------------------------------------||Attribute |Defaultvalue ||------------------------------------------------------------|---------------------------------------------------||Protocol |NO_PRIO_INHERIT || |thedefault ensures compatibility with || |implementationsthat do not support this POSIX || |option. |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|Initialized if _POSIX_THREAD_PRIO_PROTECT is defined ||------------------------------------------------------------|---------------------------------------------------||Attribute |Defaultvalue ||------------------------------------------------------------|---------------------------------------------------||Prioceiling |1 (defaultthread priority) |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|Initialized if _POSIX_THREAD_PROCESS_SHARED is defined ||------------------------------------------------------------|---------------------------------------------------||Attribute |Defaultvalue ||------------------------------------------------------------|---------------------------------------------------||Process-shared |PTHREAD_PROCESS_PRIVATE || |thedefault ensures compatibility with || |implementationsthat do not support this POSIX || |option. |------------------------------------------------------------------------------------------------------------------Note: The pthread.h header file must be the first included file ofeach source file using the threads library.Parametersattr Specifies the mutex attributes object to be created.Return ValuesUpon successful completion, the new mutex attributes object is filledwith default values and returned via the attr parameter, and 0 isreturned. Otherwise, an error code is returned.Error CodesThe pthread_mutexattr_init subroutine is unsuccessful if the followingis true:EINVAL The attr parameter is not valid.ENOMEM There is not sufficient memory to create the mutex attributesobject.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.The priority inheritance, priority protection, and process sharingPOSIX options are not implemented in the current version of AIX.Related InformationThe pthread_mutexattr_setprioceiling subroutine, pthread_mutexattr_setprotocolsubroutine, pthread_mutexattr_setpshared subroutine, pthread_mutex_initsubroutine, pthread_mutexattr_destroy subroutine.Using Mutexes.Threads Library Options and Threads Library Quick Reference.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -