HPlogo HP-UX Reference Volume 4 of 5 > p

pthread_mutex_getprioceiling(3T)

Pthread Library
» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

pthread_mutex_setprioceiling(), pthread_mutex_getprioceiling() — set or get the prioceiling of a mutex.

SYNOPSIS

#include <pthread.h>

int pthread_mutex_getprioceiling( pthread_mutex_t *mutex, int *prioceiling );

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

PARAMETERS

mutex

Pointer to the mutex whose prioceiling attribute is to be set/retrieved.

prioceiling

This parameter either points to the memory location where the prioceiling attribute of mutex is to be returned (get function) or specifies the new value of the prioceiling attribute for mutex (set function).

old_ceiling

This parameter points to the memory location where the old prioceiling attribute of mutex is to be returned (set function only).

DESCRIPTION

The pthread_mutex_setprioceiling() function will first lock mutex. If the mutex is currently locked, the calling thread will block until the mutex can be locked. Once the mutex has been locked, the prioceiling attribute of mutex will be changed to the value specified in the prioceiling parameter and mutex will be unlocked. The old priority ceiling for the mutex will be returned in old_prioceiling.

The pthread_mutex_getprioceiling() function returns the current value of the prioceiling attribute for mutex in the prioceiling parameter.

Be sure to check for the definition of _POSIX_THREAD_PRIO_PROTECT before using these functions. Not all systems will support these functions.

RETURN VALUE

Upon successful completion, pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() return zero. Otherwise, an error number is returned to indicate the error (the errno variable is not set).

ERRORS

If any of the following occur, the pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() functions return the corresponding error number:

[ENOSYS]

_POSIX_THREAD_PRIO_PROTECT is not defined and these functions are not supported.

For each of the following conditions, if the condition is detected, the pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() functions return the corresponding error number:

[EINVAL]

The priority value prioceiling is not a legal value.

[EINVAL]

mutex is not a valid mutex.

[ENOSYS]

The prioceiling protocol is not supported for mutexes.

[EPERM]

The caller does not have the appropriate privileges to change priority ceiling for mutex.

[EFAULT]

mutex parameter points to an illegal address.

AUTHOR

pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling() were derived from the IEEE POSIX P1003.1c standard.

SEE ALSO

pthread_create(3T), pthread_mutex_init(3T), pthread_mutexattr_setprioceiling(3T), pthread_mutexattr_getprioceiling(3T), pthread_mutex_lock(3T), pthread_mutex_trylock(3T), pthread_mutex_unlock(3T).

STANDARDS CONFORMANCE

pthread_mutex_getprioceiling(): POSIX 1003.1c. pthread_mutex_setprioceiling(): POSIX 1003.1c.

© Hewlett-Packard Development Company, L.P.