1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>requeue_pi_wake_futex</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 12. Futex API reference"><link rel="prev" href="API-requeue-futex.html" title="requeue_futex"><link rel="next" href="API-futex-proxy-trylock-atomic.html" title="futex_proxy_trylock_atomic"></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">requeue_pi_wake_futex</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-requeue-futex.html">Prev</a> </td><th width="60%" align="center">Chapter 12. Futex API reference</th><td width="20%" align="right"> <a accesskey="n" href="API-futex-proxy-trylock-atomic.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-requeue-pi-wake-futex"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>requeue_pi_wake_futex — 2 Wake a task that acquired the lock during requeue 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">void <b class="fsfunc">requeue_pi_wake_futex </b>(</code></td><td>struct futex_q * <var class="pdparam">q</var>, </td></tr><tr><td> </td><td>union futex_key * <var class="pdparam">key</var>, </td></tr><tr><td> </td><td>struct futex_hash_bucket * <var class="pdparam">hb</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1124849980"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>q</code></em></span></dt><dd><p> 4 the futex_q 5 </p></dd><dt><span class="term"><em class="parameter"><code>key</code></em></span></dt><dd><p> 6 the key of the requeue target futex 7 </p></dd><dt><span class="term"><em class="parameter"><code>hb</code></em></span></dt><dd><p> 8 the hash_bucket of the requeue target futex 9 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124853532"></a><h2>Description</h2><p> 10 During futex_requeue, with requeue_pi=1, it is possible to acquire the 11 target futex if it is uncontended or via a lock steal. Set the futex_q key 12 to the requeue target futex so the waiter can detect the wakeup on the right 13 futex, but remove it from the hb and NULL the rt_waiter so it can detect 14 atomic lock acquisition. Set the q->lock_ptr to the requeue target hb->lock 15 to protect access to the pi_state to fixup the owner later. Must be called 16 with both q->lock_ptr and hb->lock held. 17</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-requeue-futex.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="apiref-futex.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-futex-proxy-trylock-atomic.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">requeue_futex</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">futex_proxy_trylock_atomic</span></td></tr></table></div></body></html> 18