pthread_mutex_getprioceiling, pthread_mutex_setprioceiling - get and set the priority ceiling of a mutex (REALTIME THREADS)
[THR TPP] #include <pthread.h>
int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict mutex,
int *restrict prioceiling);
int pthread_mutex_setprioceiling(pthread_mutex_t *restrict mutex,
int prioceiling, int *restrict old_ceiling);
The pthread_mutex_getprioceiling() function shall return the current priority ceiling of the mutex.
The pthread_mutex_setprioceiling() function shall either lock the mutex if it is unlocked, or block until it can successfully lock the mutex, then it shall change the mutex's priority ceiling and release the mutex. When the change is successful, the previous value of the priority ceiling shall be returned in old_ceiling. The process of locking the mutex need not adhere to the priority protect protocol.
If the pthread_mutex_setprioceiling() function fails, the mutex priority ceiling shall not be changed.
If successful, the pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() functions shall return zero; otherwise, an error number shall be returned to indicate the error.
The pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() functions may fail if:
- [EINVAL]
- The priority requested by prioceiling is out of range.
- [EINVAL]
- The value specified by mutex does not refer to a currently existing mutex.
- [EPERM]
- The caller does not have the privilege to perform the operation.
These functions shall not return an error code of [EINTR].
None.
None.
None.
None.
pthread_mutex_destroy(), pthread_mutex_lock(), pthread_mutex_timedlock(), the Base Definitions volume of IEEE Std 1003.1-2001, <pthread.h>
First released in Issue 5. Included for alignment with the POSIX Threads Extension.
Marked as part of the Realtime Threads Feature Group.
The pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() functions are marked as part of the Threads and Thread Priority Protection options.
The [ENOSYS] error condition has been removed as stubs need not be provided if an implementation does not support the Thread Priority Protection option.
The [ENOSYS] error denoting non-support of the priority ceiling protocol for mutexes has been removed. This is because if the implementation provides the functions (regardless of whether _POSIX_PTHREAD_PRIO_PROTECT is defined), they must function as in the DESCRIPTION and therefore the priority ceiling protocol for mutexes is supported.
The pthread_mutex_timedlock() function is added to the SEE ALSO section for alignment with IEEE Std 1003.1d-1999.
The restrict keyword is added to the pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() prototypes for alignment with the ISO/IEC 9899:1999 standard.