1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>kthread_park</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="ch01s07.html" title="Internal Functions"><link rel="prev" href="API-kthread-unpark.html" title="kthread_unpark"><link rel="next" href="API-kthread-stop.html" title="kthread_stop"></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">kthread_park</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-kthread-unpark.html">Prev</a> </td><th width="60%" align="center">Internal Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-kthread-stop.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-kthread-park"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>kthread_park — 2 park a thread created by <code class="function">kthread_create</code>. 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">kthread_park </b>(</code></td><td>struct task_struct * <var class="pdparam">k</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.3.8.33.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>k</code></em></span></dt><dd><p> 4 thread created by <code class="function">kthread_create</code>. 5 </p></dd></dl></div></div><div class="refsect1"><a name="id-1.3.8.33.6"></a><h2>Description</h2><p> 6 Sets <code class="function"><a class="link" href="API-kthread-should-park.html" title="kthread_should_park">kthread_should_park</a></code> for <em class="parameter"><code>k</code></em> to return true, wakes it, and 7 waits for it to return. This can also be called after <code class="function">kthread_create</code> 8 instead of calling <code class="function"><a class="link" href="API-wake-up-process.html" title="wake_up_process">wake_up_process</a></code>: the thread will park without 9 calling <code class="function">threadfn</code>. 10 </p><p> 11 12 Returns 0 if the thread is parked, -ENOSYS if the thread exited. 13 If called by the kthread itself just the park bit is set. 14</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-kthread-unpark.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01s07.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-kthread-stop.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">kthread_unpark</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">kthread_stop</span></td></tr></table></div></body></html> 15