1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>handle_early_requeue_pi_wakeup</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-wait-setup.html" title="futex_wait_setup"><link rel="next" href="API-futex-wait-requeue-pi.html" title="futex_wait_requeue_pi"></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">handle_early_requeue_pi_wakeup</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-futex-wait-setup.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-futex-wait-requeue-pi.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-handle-early-requeue-pi-wakeup"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>handle_early_requeue_pi_wakeup &#8212; 
2     Detect early wakeup on the initial 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">handle_early_requeue_pi_wakeup </b>(</code></td><td>struct futex_hash_bucket * <var class="pdparam">hb</var>, </td></tr><tr><td>&#160;</td><td>struct futex_q * <var class="pdparam">q</var>, </td></tr><tr><td>&#160;</td><td>union futex_key * <var class="pdparam">key2</var>, </td></tr><tr><td>&#160;</td><td>struct hrtimer_sleeper * <var class="pdparam">timeout</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1124944452"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>hb</code></em></span></dt><dd><p>
4     the hash_bucket futex_q was original enqueued on
5    </p></dd><dt><span class="term"><em class="parameter"><code>q</code></em></span></dt><dd><p>
6     the futex_q woken while waiting to be requeued
7    </p></dd><dt><span class="term"><em class="parameter"><code>key2</code></em></span></dt><dd><p>
8     the futex_key of the requeue target futex
9    </p></dd><dt><span class="term"><em class="parameter"><code>timeout</code></em></span></dt><dd><p>
10     the timeout associated with the wait (NULL if none)
11    </p></dd></dl></div></div><div class="refsect1"><a name="idp1124949100"></a><h2>Description</h2><p>
12   Detect if the task was woken on the initial futex as opposed to the requeue
13   target futex.  If so, determine if it was a timeout or a signal that caused
14   the wakeup and return the appropriate error code to the caller.  Must be
15   called with the hb lock held.
16</p></div><div class="refsect1"><a name="idp1124949956"></a><h2>Return</h2><p>
17   0 = no early wakeup detected;
18   &lt;0 = -ETIMEDOUT or -ERESTARTNOINTR
19</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-wait-setup.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-futex-wait-requeue-pi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">futex_wait_setup</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">futex_wait_requeue_pi</span></td></tr></table></div></body></html>
20