The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


pthread_mutex_setprioceiling, pthread_mutex_getprioceiling - change the priority ceiling of a mutex (REALTIME THREADS)


#include <pthread.h>

int pthread_mutex_setprioceiling(pthread_mutex_t *mutex,
    int prioceiling, int *old_ceiling);
int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex,
    int *prioceiling);


The pthread_mutex_getprioceiling() function returns the current priority ceiling of the mutex.

The pthread_mutex_setprioceiling() function either locks the mutex if it is unlocked, or blocks until it can successfully lock the mutex, then it changes the mutex's priority ceiling and releases the mutex. When the change is successful, the previous value of the priority ceiling is 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 is not changed.


If successful, the pthread_mutex_setprioceiling() and pthread_mutex_getprioceiling() functions return zero. Otherwise, an error number is returned to indicate the error.


The pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() functions will fail if:
The option _POSIX_THREAD_PRIO_PROTECT is not defined and the implementation does not support the function.

The pthread_mutex_setprioceiling() and pthread_mutex_getprioceiling() functions may fail if:

The priority requested by prioceiling is out of range.
The value specified by mutex does not refer to a currently existing mutex.
The implementation does not support the priority ceiling protocol for mutexes.
The caller does not have the privilege to perform the operation.








pthread_mutex_init(), pthread_mutex_lock(), pthread_mutex_unlock(), pthread_mutex_trylock(), <pthread.h>.


Derived from the POSIX Threads Extension (1003.1c-1995)

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]