1pthread_mutex_getprioceiliSntga(n3dCa)rd C Library Funpctthiroenasd_mutex_getprioceiling(3C)
2
3
4

NAME

6       pthread_mutex_getprioceiling,   pthread_mutex_setprioceiling  -  change
7       priority ceiling of a mutex
8

SYNOPSIS

10       cc -mt [ flag... ] file... -lpthread [ library... ]
11       #include <pthread.h>
12
13       int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict mutex,
14            int *restrict prioceiling);
15
16
17       int pthread_mutex_setprioceiling(pthread_mutex_t *restrict mutex,
18            int prioceiling, int *restrict old_ceiling);
19
20

DESCRIPTION

22       The pthread_mutex_getprioceiling() function returns the current  prior‐
23       ity ceiling of the mutex.
24
25
26       The  pthread_mutex_setprioceiling()  function either locks the mutex if
27       it is unlocked, or blocks until it can  successfully  lock  the  mutex,
28       then  it  changes  the mutex's priority ceiling and releases the mutex.
29       When the change is successful, the previous value of the priority ceil‐
30       ing  is  returned in old_ceiling. The process of locking the mutex need
31       not adhere to the priority protect protocol.
32
33
34       If the pthread_mutex_setprioceiling() function fails, the mutex  prior‐
35       ity ceiling is not changed.
36
37
38       The  ceiling value should be drawn from the range of priorities for the
39       SCHED_FIFO policy. When a thread acquires such a mutex, the  policy  of
40       the  thread at mutex acquisition should match that from which the ceil‐
41       ing value was derived  (SCHED_FIFO,  in  this  case).     If  a  thread
42       changes  its  scheduling  policy  while  holding  a  ceiling mutex, the
43       behavior of pthread_mutex_lock()  and  pthread_mutex_unlock()  on  this
44       mutex is undefined. See pthread_mutex_lock(3C).
45
46
47       The  ceiling value should not be treated as a persistent value resident
48       in a pthread_mutex_t that is valid  across  upgrades  of  Solaris.  The
49       semantics  of  the  actual ceiling value are determined by the existing
50       priority  range  for  the  SCHED_FIFO  policy,  as  returned   by   the
51       sched_get_priority_min()  and  sched_get_priority_max()  functions (see
52       sched_get_priority_min(3C)) when called on the version  of  Solaris  on
53       which the ceiling value is being utilized.
54

RETURN VALUES

56       Upon  successful  completion,  the  pthread_mutex_getprioceiling()  and
57       pthread_mutex_setprioceiling() functions return  0. Otherwise, an error
58       number is returned to indicate the error.
59

ERRORS

61       The   pthread_mutex_getprioceiling() and pthread_mutex_setprioceiling()
62       functions may fail if:
63
64       EINVAL    The value specified by mutex does not refer  to  a  currently
65                 existing mutex.
66
67
68
69       The pthread_mutex_setprioceiling() function will fail if:
70
71       EINVAL    The  mutex  was  not  initialized with its protocol attribute
72                 having the value of PTHREAD_PRIO_PROTECT.
73
74
75       EINVAL    The priority requested by prioceiling is out of range.
76
77
78       EPERM     The caller does not have the privilege to perform the  opera‐
79                 tion.
80
81

ATTRIBUTES

83       See attributes(5) for descriptions of the following attributes:
84
85
86
87
88       ┌─────────────────────────────┬─────────────────────────────┐
89       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
90       ├─────────────────────────────┼─────────────────────────────┤
91       │Interface Stability          │Committed                    │
92       ├─────────────────────────────┼─────────────────────────────┤
93       │MT-Level                     │MT-Safe                      │
94       ├─────────────────────────────┼─────────────────────────────┤
95       │Standard                     │See standards(5).            │
96       └─────────────────────────────┴─────────────────────────────┘
97

SEE ALSO

99       pthread_mutex_init(3C),     pthread_mutex_lock(3C),    sched_get_prior‐
100       ity_min(3C), attributes(5), standards(5)
101
102
103
104SunOS 5.11                        1 Apr 2008  pthread_mutex_getprioceiling(3C)
Impressum