1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>futex_lock_pi_atomic</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Unreliable Guide To Locking"><link rel="up" href="apiref-futex.html" title="Chapter&#160;12.&#160;Futex API reference"><link rel="prev" href="API-futex-top-waiter.html" title="futex_top_waiter"><link rel="next" href="API---unqueue-futex.html" title="__unqueue_futex"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">futex_lock_pi_atomic</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-futex-top-waiter.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;12.&#160;Futex API reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="API---unqueue-futex.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-futex-lock-pi-atomic"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>futex_lock_pi_atomic &#8212; 
2     Atomic work required to acquire a pi aware futex
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">futex_lock_pi_atomic </b>(</code></td><td>u32 __user * <var class="pdparam">uaddr</var>, </td></tr><tr><td>&#160;</td><td>struct futex_hash_bucket * <var class="pdparam">hb</var>, </td></tr><tr><td>&#160;</td><td>union futex_key * <var class="pdparam">key</var>, </td></tr><tr><td>&#160;</td><td>struct futex_pi_state ** <var class="pdparam">ps</var>, </td></tr><tr><td>&#160;</td><td>struct task_struct * <var class="pdparam">task</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">set_waiters</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1124820076"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>uaddr</code></em></span></dt><dd><p>
4     the pi futex user address
5    </p></dd><dt><span class="term"><em class="parameter"><code>hb</code></em></span></dt><dd><p>
6     the pi futex hash bucket
7    </p></dd><dt><span class="term"><em class="parameter"><code>key</code></em></span></dt><dd><p>
8     the futex key associated with uaddr and hb
9    </p></dd><dt><span class="term"><em class="parameter"><code>ps</code></em></span></dt><dd><p>
10     the pi_state pointer where we store the result of the
11     lookup
12    </p></dd><dt><span class="term"><em class="parameter"><code>task</code></em></span></dt><dd><p>
13     the task to perform the atomic lock work for.  This will
14     be <span class="quote">&#8220;<span class="quote">current</span>&#8221;</span> except in the case of requeue pi.
15    </p></dd><dt><span class="term"><em class="parameter"><code>set_waiters</code></em></span></dt><dd><p>
16     force setting the FUTEX_WAITERS bit (1) or not (0)
17    </p></dd></dl></div></div><div class="refsect1"><a name="idp1124826996"></a><h2>Return</h2><p>
18   0 - ready to wait;
19   1 - acquired the lock;
20   &lt;0 - error
21   </p><p>
22
23   The hb-&gt;lock and futex_key refs shall be held by the caller.
24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-futex-top-waiter.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="apiref-futex.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API---unqueue-futex.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">futex_top_waiter</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">__unqueue_futex</span></td></tr></table></div></body></html>
25