MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Standard C Library Functions     pthreadmutexgetprioceiling(3C)



NAME
     pthreadmutexgetprioceiling, pthreadmutexsetprioceiling -
     change priority ceiling of a mutex

SYNOPSIS
     cc -mt [ flag... ] file... -lpthread [ library... ]
     #include 

     int pthreadmutexgetprioceiling(const pthreadmutext *restrict mutex,
          int *restrict prioceiling);


     int pthreadmutexsetprioceiling(pthreadmutext *restrict mutex,
          int prioceiling, int *restrict oldceiling);


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


     The pthreadmutexsetprioceiling() 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
     oldceiling.  The  process  of  locking  the  mutex need not
     adhere to the priority protect protocol.


     If the pthreadmutexsetprioceiling()  function  fails,  the
     mutex priority ceiling is not changed.


     The ceiling value should be drawn from the range of  priori-
     ties  for the SCHEDFIFO policy. When a thread acquires such
     a mutex, the policy  of  the  thread  at  mutex  acquisition
     should  match  that from which the ceiling value was derived
     (SCHEDFIFO, in this  case).     If  a  thread  changes  its
     scheduling   policy  while  holding  a  ceiling  mutex,  the
     behavior of pthreadmutexlock() and  pthreadmutexunlock()
     on this mutex is undefined. See pthreadmutexlock(3C).


     The ceiling value should not  be  treated  as  a  persistent
     value  resident  in  a  pthreadmutext that is valid across
     upgrades of Solaris. The semantics  of  the  actual  ceiling
     value  are determined by the existing priority range for the
     SCHEDFIFO     policy,     as     returned       by      the
     schedgetprioritymin()  and schedgetprioritymax() func-
     tions (see schedgetprioritymin(3C)) when  called  on  the
     version  of  Solaris  on  which  the  ceiling value is being



SunOS 5.11           Last change: 1 Apr 2008                    1






Standard C Library Functions     pthreadmutexgetprioceiling(3C)



     utilized.

RETURN VALUES
     Upon          successful           completion,           the
     pthreadmutexgetprioceiling()                           and
     pthreadmutexsetprioceiling() functions return   0.  Other-
     wise, an error number is returned to indicate the error.

ERORS
     The            pthreadmutexgetprioceiling()            and
     pthreadmutexsetprioceiling() functions may fail if:

     EINVAL    The value specified by mutex does not refer  to  a
               currently existing mutex.



     The pthreadmutexsetprioceiling() function will fail if:

     EINVAL    The mutex was not initialized  with  its  protocol
               attribute       having      the      value      of
               PTHREADPRIOPROTECT.


     EINVAL    The priority requested by prioceiling  is  out  of
               range.


     EPERM     The caller does not have the privilege to  perform
               the operation.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:




















SunOS 5.11           Last change: 1 Apr 2008                    2






Standard C Library Functions     pthreadmutexgetprioceiling(3C)



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    
     MT-Level                     MT-Safe                     
    
     Standard                     See standards(5).           
    


SEE ALSO
     pthreadmutexinit(3C),              pthreadmutexlock(3C),
     schedgetprioritymin(3C), attributes(5), standards(5)









































SunOS 5.11           Last change: 1 Apr 2008                    3



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™