Files
oldlinux-files/Ref-docs/POSIX/susv3/functions/pthread_mutex_getprioceiling.html
2024-02-19 00:21:47 -05:00

164 lines
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>pthread_mutex_getprioceiling</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="pthread_mutex_getprioceiling"></a> <a name="tag_03_538"></a><!-- pthread_mutex_getprioceiling -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_03_538_01"></a>NAME</h4>
<blockquote>pthread_mutex_getprioceiling, pthread_mutex_setprioceiling - get and set the priority ceiling of a mutex (<b>REALTIME
THREADS</b>)</blockquote>
<h4><a name="tag_03_538_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><code><tt><sup>[<a href="javascript:open_code('THR TPP')">THR TPP</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;<a href="../basedefs/pthread.h.html">pthread.h</a>&gt;<br>
<br>
int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict</tt> <i>mutex</i><tt>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int *restrict</tt> <i>prioceiling</i><tt>);<br>
int pthread_mutex_setprioceiling(pthread_mutex_t *restrict</tt> <i>mutex</i><tt>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</tt> <i>prioceiling</i><tt>, int *restrict</tt> <i>old_ceiling</i><tt>); <img src=
"../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
<tt><br>
</tt></blockquote>
<h4><a name="tag_03_538_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>pthread_mutex_getprioceiling</i>() function shall return the current priority ceiling of the mutex.</p>
<p>The <i>pthread_mutex_setprioceiling</i>() 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 <i>old_ceiling</i>. The process of locking the mutex
need not adhere to the priority protect protocol.</p>
<p>If the <i>pthread_mutex_setprioceiling</i>() function fails, the mutex priority ceiling shall not be changed.</p>
</blockquote>
<h4><a name="tag_03_538_04"></a>RETURN VALUE</h4>
<blockquote>
<p>If successful, the <i>pthread_mutex_getprioceiling</i>() and <i>pthread_mutex_setprioceiling</i>() functions shall return zero;
otherwise, an error number shall be returned to indicate the error.</p>
</blockquote>
<h4><a name="tag_03_538_05"></a>ERRORS</h4>
<blockquote>
<p>The <i>pthread_mutex_getprioceiling</i>() and <i>pthread_mutex_setprioceiling</i>() functions may fail if:</p>
<dl compact>
<dt>[EINVAL]</dt>
<dd>The priority requested by <i>prioceiling</i> is out of range.</dd>
<dt>[EINVAL]</dt>
<dd>The value specified by <i>mutex</i> does not refer to a currently existing mutex.</dd>
<dt>[EPERM]</dt>
<dd>The caller does not have the privilege to perform the operation.</dd>
</dl>
<p>These functions shall not return an error code of [EINTR].</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_03_538_06"></a>EXAMPLES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_538_07"></a>APPLICATION USAGE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_538_08"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_538_09"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_538_10"></a>SEE ALSO</h4>
<blockquote>
<p><a href="pthread_mutex_destroy.html"><i>pthread_mutex_destroy</i>()</a> , <a href=
"pthread_mutex_lock.html"><i>pthread_mutex_lock</i>()</a> , <a href=
"pthread_mutex_timedlock.html"><i>pthread_mutex_timedlock</i>()</a> , the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/pthread.h.html"><i>&lt;pthread.h&gt;</i></a></p>
</blockquote>
<h4><a name="tag_03_538_11"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 5. Included for alignment with the POSIX Threads Extension.</p>
<p>Marked as part of the Realtime Threads Feature Group.</p>
</blockquote>
<h4><a name="tag_03_538_12"></a>Issue 6</h4>
<blockquote>
<p>The <i>pthread_mutex_getprioceiling</i>() and <i>pthread_mutex_setprioceiling</i>() functions are marked as part of the Threads
and Thread Priority Protection options.</p>
<p>The [ENOSYS] error condition has been removed as stubs need not be provided if an implementation does not support the Thread
Priority Protection option.</p>
<p>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.</p>
<p>The <a href="../functions/pthread_mutex_timedlock.html"><i>pthread_mutex_timedlock</i>()</a> function is added to the SEE ALSO
section for alignment with IEEE&nbsp;Std&nbsp;1003.1d-1999.</p>
<p>The <b>restrict</b> keyword is added to the <i>pthread_mutex_getprioceiling</i>() and <i>pthread_mutex_setprioceiling</i>()
prototypes for alignment with the ISO/IEC&nbsp;9899:1999 standard.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>