1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>mod_delayed_work_on</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="ch01s06.html" title="Workqueues and Kevents"><link rel="prev" href="API-queue-delayed-work-on.html" title="queue_delayed_work_on"><link rel="next" href="API-flush-workqueue.html" title="flush_workqueue"></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">mod_delayed_work_on</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-queue-delayed-work-on.html">Prev</a>&#160;</td><th width="60%" align="center">Workqueues and Kevents</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-flush-workqueue.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-mod-delayed-work-on"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>mod_delayed_work_on &#8212; 
2     modify delay of or queue a delayed work on specific CPU
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">bool <b class="fsfunc">mod_delayed_work_on </b>(</code></td><td>int <var class="pdparam">cpu</var>, </td></tr><tr><td>&#160;</td><td>struct workqueue_struct * <var class="pdparam">wq</var>, </td></tr><tr><td>&#160;</td><td>struct delayed_work * <var class="pdparam">dwork</var>, </td></tr><tr><td>&#160;</td><td>unsigned long <var class="pdparam">delay</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1107694844"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>cpu</code></em></span></dt><dd><p>
4     CPU number to execute work on
5    </p></dd><dt><span class="term"><em class="parameter"><code>wq</code></em></span></dt><dd><p>
6     workqueue to use
7    </p></dd><dt><span class="term"><em class="parameter"><code>dwork</code></em></span></dt><dd><p>
8     work to queue
9    </p></dd><dt><span class="term"><em class="parameter"><code>delay</code></em></span></dt><dd><p>
10     number of jiffies to wait before queueing
11    </p></dd></dl></div></div><div class="refsect1"><a name="idp1107699516"></a><h2>Description</h2><p>
12   If <em class="parameter"><code>dwork</code></em> is idle, equivalent to <code class="function">queue_delayed_work_on</code>; otherwise,
13   modify <em class="parameter"><code>dwork</code></em>'s timer so that it expires after <em class="parameter"><code>delay</code></em>.  If <em class="parameter"><code>delay</code></em> is
14   zero, <em class="parameter"><code>work</code></em> is guaranteed to be scheduled immediately regardless of its
15   current state.
16</p></div><div class="refsect1"><a name="idp1107702436"></a><h2>Return</h2><p>
17   <code class="constant">false</code> if <em class="parameter"><code>dwork</code></em> was idle and queued, <code class="constant">true</code> if <em class="parameter"><code>dwork</code></em> was
18   pending and its timer was modified.
19   </p><p>
20
21   This function is safe to call from any context including IRQ handler.
22   See <code class="function">try_to_grab_pending</code> for details.
23</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-queue-delayed-work-on.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch01s06.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-flush-workqueue.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">queue_delayed_work_on</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">flush_workqueue</span></td></tr></table></div></body></html>
24