1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>alloc_workqueue</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-delayed-work-pending.html" title="delayed_work_pending"><link rel="next" href="API-alloc-ordered-workqueue.html" title="alloc_ordered_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">alloc_workqueue</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-delayed-work-pending.html">Prev</a> </td><th width="60%" align="center">Workqueues and Kevents</th><td width="20%" align="right"> <a accesskey="n" href="API-alloc-ordered-workqueue.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-alloc-workqueue"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>alloc_workqueue — 2 allocate a workqueue 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"> <b class="fsfunc">alloc_workqueue </b>(</code></td><td> <var class="pdparam">fmt</var>, </td></tr><tr><td> </td><td> <var class="pdparam">flags</var>, </td></tr><tr><td> </td><td> <var class="pdparam">max_active</var>, </td></tr><tr><td> </td><td> <var class="pdparam">args...</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.3.7.4.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fmt</code></em></span></dt><dd><p> 4 printf format for the name of the workqueue 5 </p></dd><dt><span class="term"><em class="parameter"><code>flags</code></em></span></dt><dd><p> 6 WQ_* flags 7 </p></dd><dt><span class="term"><em class="parameter"><code>max_active</code></em></span></dt><dd><p> 8 max in-flight work items, 0 for default 9 <em class="parameter"><code>args</code></em>...: args for <em class="parameter"><code>fmt</code></em> 10 </p></dd><dt><span class="term"><em class="parameter"><code>args...</code></em></span></dt><dd><p> 11 variable arguments 12 </p></dd></dl></div></div><div class="refsect1"><a name="id-1.3.7.4.6"></a><h2>Description</h2><p> 13 Allocate a workqueue with the specified parameters. For detailed 14 information on WQ_* flags, please refer to Documentation/workqueue.txt. 15 </p><p> 16 17 The __lock_name macro dance is to guarantee that single lock_class_key 18 doesn't end up with different namesm, which isn't allowed by lockdep. 19</p></div><div class="refsect1"><a name="id-1.3.7.4.7"></a><h2>RETURNS</h2><p> 20 Pointer to the allocated workqueue on success, <code class="constant">NULL</code> on failure. 21</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-delayed-work-pending.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01s06.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-alloc-ordered-workqueue.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">delayed_work_pending</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">alloc_ordered_workqueue</span></td></tr></table></div></body></html> 22