?? pthread_mutexattr_setprotocol.txt
字號:
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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -