pthread_mutexattr_setprotocol.txt

来自「Pthread lib库完整说明文档」· 文本 代码 · 共 89 行

TXT
89
字号
pthread_mutexattr_setprotocol SubroutinePurposeSets the value of the protocol attribute of a mutex attributes object.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_mutexattr_setprotocol (attr, protocol)pthread_mutexattr_t *attr;int protocol;DescriptionThe pthread_mutexattr_setprotocol subroutine sets the value of theprotocol attribute of the mutex attributes object attr. This attributespecifies the protocol used to prevent priority inversions for themutex created with this attributes object.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.protocol	Specifies the protocol to set. It must have one of the followingvalues:PTHREAD_PRIO_NONE	Denotes no protocol. This is the default value.PTHREAD_PRIO_INHERIT	Denotes priority inheritance protocol. It isonly available if the _POSIX_THREAD_PRIO_INHERIT symbol is defined.Otherwise, it is not supported.PTHREAD_PRIO_PROTECT	Denotes priority protection protocol. It is onlyavailable if the _POSIX_THREAD_PRIO_PROTECT symbol is defined. Otherwise,it is not supported.Return ValuesUpon successful completion, 0 is returned. Otherwise, an error codeis returned.Error CodesThe pthread_mutexattr_setprotocol subroutine is unsuccessful if thefollowing is true:EINVAL	The attr parameter is not valid.ENOSYS	Both priority inheritance and priority protection POSIX optionsare not implemented.ENOTSUP	The value of the protocol parameter is not supported.EPERM	The calling thread does not have sufficient privilege to performthe operation.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.The implementation of this subroutine is dependent on the priorityinheritance or priority protection POSIX option. Both priority inheritanceand priority protection POSIX options are not implemented in the currentversion of AIX.Related InformationThe pthread_mutexattr_getprotocol subroutine, pthread_mutexattr_initsubroutine, pthread_mutex_init subroutine.Synchronization Scheduling.Threads Library Options and Threads Library Quick Reference.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?