pthread_mutex_setprioceiling.txt
来自「Pthread lib库完整说明文档」· 文本 代码 · 共 91 行
TXT
91 行
pthread_mutex_setprioceiling SubroutinePurposeDynamically sets the value of the prioceiling attribute of a mutex.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_mutex_setprioceiling (mutex, prioceiling, oldceiling)pthread_mutex_t *mutex;int prioceiling;int *oldceiling;DescriptionThe pthread_mutex_setprioceiling subroutine dynamically sets the valueof the prioceiling attribute of the mutex mutex. This attribute specifiesthe priority ceiling of the mutex, used in the priority protectionprotocol to prevent priority inversions. It has no meaning if themutex uses another protocol. It first locks the mutex (waiting ifthe mutex is already locked), then changes the value of the prioceilingattribute, and finally unlocks the mutex.Note: The pthread.h header file must be the first included file ofeach source file using the threads library.Parametersmutex Specifies the target mutex.prioceiling Specifies the priority ceiling to set. It must be in therange from 1 to 127, where 1 is the least favored priority, and 127the most favored; it should be the priority of the highest prioritythread that can lock the mutex lock, or higher. Setting a lower valuemay cause priority inversions.oldceiling Points to where the previous prioceiling attribute valuewill be stored.Return ValuesUpon successful completion, the previous value of the prioceilingattribute is returned via the oldceiling parameter, and 0 is returned.Otherwise, an error code is returned.Error CodesThe pthread_mutex_setprioceiling subroutine is unsuccessful if thefollowing is true:EINVAL The mutex parameter is not valid or the requested value forprioceiling is not within the valid range.ENOSYS The priority protection POSIX option is not implemented.EPERM The calling thread does not have sufficient privilege to performthe operation.ESRCH The mutex mutex does not exist.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.The implementation of this subroutine is dependent on the priorityprotection POSIX option. The priority protection POSIX option is notimplemented in the current version of AIX.Related InformationThe pthread_mutex_getprioceiling subroutine, pthread_mutexattr_setprioceilingsubroutine.Synchronization Scheduling.Threads Library Options.Threads Library Quick Reference.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?