<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>queue_me</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-futex-requeue.html" title="futex_requeue" /><link rel="next" href="API-unqueue-me.html" title="unqueue_me" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">queue_me</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-futex-requeue.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-unqueue-me.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="API-queue-me"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>queue_me — Enqueue the futex_q on the futex_hash_bucket </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 <strong class="fsfunc">queue_me </strong>(</code></td><td>struct futex_q * <var class="pdparam">q</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 id="idm140391695993312"></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> The futex_q to enqueue </p></dd><dt><span class="term"><em class="parameter"><code>hb</code></em></span></dt><dd><p> The destination hash bucket </p></dd></dl></div></div><div class="refsect1"><a id="idm140391695988352"></a><h2>Description</h2><p> The hb->lock must be held by the caller, and is released here. A call to <code class="function">queue_me</code> is typically paired with exactly one call to <code class="function">unqueue_me</code>. The exceptions involve the PI related operations, which may use <code class="function">unqueue_me_pi</code> or nothing if the unqueue is done as part of the wake process and the unqueue state is implicit in the state of woken task (see <code class="function">futex_wait_requeue_pi</code> for an example). </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-requeue.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-unqueue-me.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">futex_requeue</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">unqueue_me</span></td></tr></table></div></body></html>