1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>schedule_hrtimeout</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch01s05.html" title="High-resolution timers"><link rel="prev" href="API-schedule-hrtimeout-range.html" title="schedule_hrtimeout_range"><link rel="next" href="ch01s06.html" title="Workqueues and Kevents"></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">schedule_hrtimeout</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-schedule-hrtimeout-range.html">Prev</a>&#160;</td><th width="60%" align="center">High-resolution timers</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch01s06.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-schedule-hrtimeout"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>schedule_hrtimeout &#8212; 
2     sleep until timeout
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 __sched <b class="fsfunc">schedule_hrtimeout </b>(</code></td><td>ktime_t * <var class="pdparam">expires</var>, </td></tr><tr><td>&#160;</td><td>const enum hrtimer_mode <var class="pdparam">mode</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1107657988"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>expires</code></em></span></dt><dd><p>
4     timeout value (ktime_t)
5    </p></dd><dt><span class="term"><em class="parameter"><code>mode</code></em></span></dt><dd><p>
6     timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
7    </p></dd></dl></div></div><div class="refsect1"><a name="idp1107660652"></a><h2>Description</h2><p>
8   Make the current task sleep until the given expiry time has
9   elapsed. The routine will return immediately unless
10   the current task state has been set (see <code class="function">set_current_state</code>).
11   </p><p>
12
13   You can set the task state as follows -
14   </p><p>
15
16   <code class="constant">TASK_UNINTERRUPTIBLE</code> - at least <em class="parameter"><code>timeout</code></em> time is guaranteed to
17   pass before the routine returns.
18   </p><p>
19
20   <code class="constant">TASK_INTERRUPTIBLE</code> - the routine may return early if a signal is
21   delivered to the current task.
22   </p><p>
23
24   The current task state is guaranteed to be TASK_RUNNING when this
25   routine returns.
26   </p><p>
27
28   Returns 0 when the timer has expired otherwise -EINTR
29</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-schedule-hrtimeout-range.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch01s05.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch01s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">schedule_hrtimeout_range</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;Workqueues and Kevents</td></tr></table></div></body></html>
30