gnuk/ChibiOS_2.0.2/docs/html/group__condvars.html
2010-08-10 12:11:02 +09:00

585 lines
47 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: Condition Variables</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>Condition Variables<br/>
<small>
[<a class="el" href="group__synchronization.html">Synchronization</a>]</small>
</h1>
<p><div class="dynheader">
Collaboration diagram for Condition Variables:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__condvars.png" border="0" alt="" usemap="#group____condvars_map"/>
<map name="group____condvars_map" id="group____condvars">
<area shape="rect" href="group__synchronization.html" title="Synchronization" alt="" coords="7,5,105,29"/>
</map></td></tr></table></center>
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<p>This module implements the Condition Variables mechanism. Condition variables are an extensions to the <a class="el" href="struct_mutex.html" title="Mutex structure.">Mutex</a> subsystem and cannot work alone. </p>
<h2>Operation mode</h2>
<p>The condition variable is a synchronization object meant to be used inside a zone protected by a <code><a class="el" href="struct_mutex.html" title="Mutex structure.">Mutex</a></code>. Mutexes and CondVars together can implement a Monitor construct.<br/>
In order to use the Condition Variables APIs the <code>CH_USE_CONDVARS</code> option must be enabled in <code><a class="el" href="chconf_8h.html" title="Configuration file template.">chconf.h</a></code>. </p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_cond_var.html">CondVar</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a> structure. <a href="struct_cond_var.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga5d435ff663d0d9f3d54427cba4faf00f">_CONDVAR_DATA</a>(name)&nbsp;&nbsp;&nbsp;{_THREADSQUEUE_DATA(name.c_queue)}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data part of a static condition variable initializer. <a href="#ga5d435ff663d0d9f3d54427cba4faf00f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga3ea56c50eb9ddff1cf665e8fb60ba6ac">CONDVAR_DECL</a>(name)&nbsp;&nbsp;&nbsp;<a class="el" href="struct_cond_var.html">CondVar</a> name = _CONDVAR_DATA(name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Static condition variable initializer. <a href="#ga3ea56c50eb9ddff1cf665e8fb60ba6ac"></a><br/></td></tr>
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_cond_var.html">CondVar</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#gae0fef080503c53ea65ef634f665ae06a">CondVar</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a> structure. <a href="#gae0fef080503c53ea65ef634f665ae06a"></a><br/></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga4c698ba6ce06089c08f989e126af9873">chCondInit</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes s <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure. <a href="#ga4c698ba6ce06089c08f989e126af9873"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996">chCondSignal</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signals one thread that is waiting on the condition variable. <a href="#gadddadb68e2a2ce061c7df0d647da9996"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga7b9d882c348124fed46a1afc3db6c02c">chCondSignalI</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signals one thread that is waiting on the condition variable. <a href="#ga7b9d882c348124fed46a1afc3db6c02c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6">chCondBroadcast</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signals all threads that are waiting on the condition variable. <a href="#ga60c24a8060a884313efe82b8404e77f6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga5cf1f4697985d81ee089b042391df6fc">chCondBroadcastI</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signals all threads that are waiting on the condition variable. <a href="#ga5cf1f4697985d81ee089b042391df6fc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga466f912bc9b09b133fae862993004ffe">chCondWait</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits on the condition variable releasing the mutex lock. <a href="#ga466f912bc9b09b133fae862993004ffe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#gab6357d80b01ed8d225ef1e30a66248f9">chCondWaitS</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits on the condition variable releasing the mutex lock. <a href="#gab6357d80b01ed8d225ef1e30a66248f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga07a0c55ac1002a64e8c7f9b7e3ca1caf">chCondWaitTimeout</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a> time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits on the condition variable releasing the mutex lock. <a href="#ga07a0c55ac1002a64e8c7f9b7e3ca1caf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__condvars.html#ga9cf6ebe4c9f28cb206fab14984a18d29">chCondWaitTimeoutS</a> (<a class="el" href="struct_cond_var.html">CondVar</a> *cp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a> time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits on the condition variable releasing the mutex lock. <a href="#ga9cf6ebe4c9f28cb206fab14984a18d29"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga5d435ff663d0d9f3d54427cba4faf00f"></a><!-- doxytag: member="chcond.h::_CONDVAR_DATA" ref="ga5d435ff663d0d9f3d54427cba4faf00f" args="(name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _CONDVAR_DATA</td>
<td>(</td>
<td class="paramtype">name&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;{_THREADSQUEUE_DATA(name.c_queue)}</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Data part of a static condition variable initializer. </p>
<p>This macro should be used when statically initializing a condition variable that is part of a bigger structure.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the condition variable </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8h_source.html#l00083">83</a> of file <a class="el" href="chcond_8h_source.html">chcond.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga3ea56c50eb9ddff1cf665e8fb60ba6ac"></a><!-- doxytag: member="chcond.h::CONDVAR_DECL" ref="ga3ea56c50eb9ddff1cf665e8fb60ba6ac" args="(name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CONDVAR_DECL</td>
<td>(</td>
<td class="paramtype">name&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a class="el" href="struct_cond_var.html">CondVar</a> name = _CONDVAR_DATA(name)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Static condition variable initializer. </p>
<p>Statically initialized condition variables require no explicit initialization using <code><a class="el" href="group__condvars.html#ga4c698ba6ce06089c08f989e126af9873" title="Initializes s CondVar structure.">chCondInit()</a></code>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the condition variable </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8h_source.html#l00092">92</a> of file <a class="el" href="chcond_8h_source.html">chcond.h</a>.</p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gae0fef080503c53ea65ef634f665ae06a"></a><!-- doxytag: member="chcond.h::CondVar" ref="gae0fef080503c53ea65ef634f665ae06a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="struct_cond_var.html">CondVar</a> <a class="el" href="struct_cond_var.html">CondVar</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a> structure. </p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga4c698ba6ce06089c08f989e126af9873"></a><!-- doxytag: member="chcond.h::chCondInit" ref="ga4c698ba6ce06089c08f989e126af9873" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chCondInit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes s <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>This function can be invoked from within an interrupt handler even if it is not an I-Class API because it does not touch any critical kernel data structure.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00059">59</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="struct_cond_var.html#a0d320ca091de542fccfebabc7716f666">CondVar::c_queue</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, and <a class="el" href="group__internals.html#ga6d19d0f3ff1fa599b6d9783dec180451">queue_init</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_cond_var.html#a1b9e183dd1c97f1a0104f57f47197ecc">chibios_rt::CondVar::CondVar()</a>.</p>
</div>
</div>
<a class="anchor" id="gadddadb68e2a2ce061c7df0d647da9996"></a><!-- doxytag: member="chcond.h::chCondSignal" ref="gadddadb68e2a2ce061c7df0d647da9996" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chCondSignal </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Signals one thread that is waiting on the condition variable. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00071">71</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="struct_cond_var.html#a0d320ca091de542fccfebabc7716f666">CondVar::c_queue</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__scheduler.html#gae47a8819a21ef2d521124e76bfb37c95">chSchWakeupS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a">fifo_remove()</a>, <a class="el" href="group__internals.html#ga8f6bea56a53acc44758fe61c98d68a4e">notempty</a>, and <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_cond_var.html#a075c5724485b6f47bdf6f1f003154f02">chibios_rt::CondVar::Signal()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph.png" border="0" usemap="#group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph_map" alt=""></div>
<map name="group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph_map" id="group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph">
<area shape="rect" href="group__scheduler.html#gae47a8819a21ef2d521124e76bfb37c95" title="Wakes up a thread." alt="" coords="141,29,240,53"/>
<area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="151,77,231,101"/>
<area shape="rect" href="group__debug.html#gac7f8f0653faf2e3a93108ff5333821b7" title="Inserts in the circular debug trace buffer a context switch record." alt="" coords="291,5,371,29"/>
<area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="288,53,373,77"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga7b9d882c348124fed46a1afc3db6c02c"></a><!-- doxytag: member="chcond.h::chCondSignalI" ref="ga7b9d882c348124fed46a1afc3db6c02c" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chCondSignalI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Signals one thread that is waiting on the condition variable. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00086">86</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="struct_cond_var.html#a0d320ca091de542fccfebabc7716f666">CondVar::c_queue</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298">chSchReadyI()</a>, <a class="el" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a">fifo_remove()</a>, <a class="el" href="group__internals.html#ga8f6bea56a53acc44758fe61c98d68a4e">notempty</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>, and <a class="el" href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">Thread::rdymsg</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph.png" border="0" usemap="#group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph_map" alt=""></div>
<map name="group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph_map" id="group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph">
<area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="144,5,229,29"/>
<area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="147,53,227,77"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga60c24a8060a884313efe82b8404e77f6"></a><!-- doxytag: member="chcond.h::chCondBroadcast" ref="ga60c24a8060a884313efe82b8404e77f6" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chCondBroadcast </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Signals all threads that are waiting on the condition variable. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00099">99</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="group__condvars.html#ga5cf1f4697985d81ee089b042391df6fc">chCondBroadcastI()</a>, <a class="el" href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20">chSchRescheduleS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_cond_var.html#a0111c4947178c9ef6b15e03f24d2e861">chibios_rt::CondVar::Broadcast()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph.png" border="0" usemap="#group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph_map" alt=""></div>
<map name="group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph_map" id="group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph">
<area shape="rect" href="group__condvars.html#ga5cf1f4697985d81ee089b042391df6fc" title="Signals all threads that are waiting on the condition variable." alt="" coords="336,5,445,29"/>
<area shape="rect" href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20" title="Performs a reschedule if a higher priority thread is runnable." alt="" coords="164,53,279,77"/>
<area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="501,5,587,29"/>
<area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="504,53,584,77"/>
<area shape="rect" href="group__scheduler.html#ga0257cf203e72a766a52059750cb97e6e" title="Switches to the first thread on the runnable queue." alt="" coords="329,53,452,77"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga5cf1f4697985d81ee089b042391df6fc"></a><!-- doxytag: member="chcond.h::chCondBroadcastI" ref="ga5cf1f4697985d81ee089b042391df6fc" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chCondBroadcastI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Signals all threads that are waiting on the condition variable. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00112">112</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="struct_cond_var.html#a0d320ca091de542fccfebabc7716f666">CondVar::c_queue</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298">chSchReadyI()</a>, <a class="el" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a">fifo_remove()</a>, <a class="el" href="struct_threads_queue.html#af4a099c245d7ceecdf2f9755d05d0ed0">ThreadsQueue::p_next</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="group__scheduler.html#ga3a606c833796229f23adcb3f6c404a81">RDY_RESET</a>, and <a class="el" href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">Thread::rdymsg</a>.</p>
<p>Referenced by <a class="el" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6">chCondBroadcast()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph.png" border="0" usemap="#group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph_map" alt=""></div>
<map name="group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph_map" id="group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph">
<area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="165,5,251,29"/>
<area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="168,53,248,77"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga466f912bc9b09b133fae862993004ffe"></a><!-- doxytag: member="chcond.h::chCondWait" ref="ga466f912bc9b09b133fae862993004ffe" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chCondWait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits on the condition variable releasing the mutex lock. </p>
<p>Releases the currently owned mutex, waits on the condition variable, and finally acquires the mutex again. All the sequence is performed atomically. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The invoking thread <b>must</b> have at least one owned mutex on entry.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The wakep mode. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>RDY_OK</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996" title="Signals one thread that is waiting on the condition variable.">chCondSignal()</a></code>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RDY_RESET</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6" title="Signals all threads that are waiting on the condition variable.">chCondBroadcast()</a></code>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00136">136</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="group__condvars.html#gab6357d80b01ed8d225ef1e30a66248f9">chCondWaitS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_cond_var.html#a37e0b0cb4ac5cbe6bbb56c51539284c8">chibios_rt::CondVar::Wait()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph.png" border="0" usemap="#group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph_map" alt=""></div>
<map name="group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph_map" id="group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph">
<area shape="rect" href="group__condvars.html#gab6357d80b01ed8d225ef1e30a66248f9" title="Waits on the condition variable releasing the mutex lock." alt="" coords="135,55,220,79"/>
<area shape="rect" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="275,29,355,53"/>
<area shape="rect" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986" title="Puts the current thread to sleep into the specified state." alt="" coords="409,5,508,29"/>
<area shape="rect" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="423,53,495,77"/>
<area shape="rect" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="271,128,359,152"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gab6357d80b01ed8d225ef1e30a66248f9"></a><!-- doxytag: member="chcond.h::chCondWaitS" ref="gab6357d80b01ed8d225ef1e30a66248f9" args="(CondVar *cp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chCondWaitS </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits on the condition variable releasing the mutex lock. </p>
<p>Releases the currently owned mutex, waits on the condition variable, and finally acquires the mutex again. All the sequence is performed atomically. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The invoking thread <b>must</b> have at least one owned mutex on entry.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The wakep mode. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>RDY_OK</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996" title="Signals one thread that is waiting on the condition variable.">chCondSignal()</a></code>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RDY_RESET</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6" title="Signals all threads that are waiting on the condition variable.">chCondBroadcast()</a></code>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00158">158</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="struct_cond_var.html#a0d320ca091de542fccfebabc7716f666">CondVar::c_queue</a>, <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5">chMtxLockS()</a>, <a class="el" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96">chMtxUnlockS()</a>, <a class="el" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986">chSchGoSleepS()</a>, <a class="el" href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7">currp</a>, <a class="el" href="struct_thread.html#a3ae80b4b3de4c7a23c542ca251e1f017">Thread::p_mtxlist</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2">prio_insert()</a>, <a class="el" href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">Thread::rdymsg</a>, <a class="el" href="group__threads.html#ga286c5b1a6459d654d5794fc17e93c939">THD_STATE_WTCOND</a>, and <a class="el" href="struct_thread.html#a4f016b01444741e6f9b420436b748862">Thread::wtobjp</a>.</p>
<p>Referenced by <a class="el" href="group__condvars.html#ga466f912bc9b09b133fae862993004ffe">chCondWait()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph.png" border="0" usemap="#group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph_map" alt=""></div>
<map name="group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph_map" id="group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph">
<area shape="rect" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="147,116,227,140"/>
<area shape="rect" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986" title="Puts the current thread to sleep into the specified state." alt="" coords="281,69,380,93"/>
<area shape="rect" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="295,165,367,189"/>
<area shape="rect" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="143,17,231,41"/>
<area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="288,21,373,45"/>
<area shape="rect" href="group__internals.html#gafff11bcd31d7dc3d1a0a6c66f3fc6ec9" title="Removes a Thread from a queue and returns it." alt="" coords="299,117,363,141"/>
<area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="429,21,509,45"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga07a0c55ac1002a64e8c7f9b7e3ca1caf"></a><!-- doxytag: member="chcond.h::chCondWaitTimeout" ref="ga07a0c55ac1002a64e8c7f9b7e3ca1caf" args="(CondVar *cp, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chCondWaitTimeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a>&nbsp;</td>
<td class="paramname"> <em>time</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits on the condition variable releasing the mutex lock. </p>
<p>Releases the currently owned mutex, waits on the condition variable, and finally acquires the mutex again. All the sequence is performed atomically. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The invoking thread <b>must</b> have at least one owned mutex on entry. </dd>
<dd>
Exiting the function because a timeout does not re-acquire the mutex, the mutex ownership is lost.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>time</em>&nbsp;</td><td>the number of ticks before the operation timeouts, the special value <code>TIME_INFINITE</code> is allowed. It is not possible to specify zero <code>TIME_IMMEDIATE</code> as timeout specification because it would make no sense in this function. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The wakep mode. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>RDY_OK</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996" title="Signals one thread that is waiting on the condition variable.">chCondSignal()</a></code>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RDY_RESET</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6" title="Signals all threads that are waiting on the condition variable.">chCondBroadcast()</a></code>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RDY_TIMEOUT</em>&nbsp;</td><td>if the condvar was not signaled <code>within</code> the specified timeout. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00200">200</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="group__condvars.html#ga9cf6ebe4c9f28cb206fab14984a18d29">chCondWaitTimeoutS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_cond_var.html#a866a352fb3bc95f07abda728d4ae4906">chibios_rt::CondVar::WaitTimeout()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph.png" border="0" usemap="#group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph_map" alt=""></div>
<map name="group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph_map" id="group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph">
<area shape="rect" href="group__condvars.html#ga9cf6ebe4c9f28cb206fab14984a18d29" title="Waits on the condition variable releasing the mutex lock." alt="" coords="172,80,295,104"/>
<area shape="rect" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="373,5,453,29"/>
<area shape="rect" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="531,31,603,55"/>
<area shape="rect" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="369,104,457,128"/>
<area shape="rect" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification..." alt="" coords="345,152,481,176"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga9cf6ebe4c9f28cb206fab14984a18d29"></a><!-- doxytag: member="chcond.h::chCondWaitTimeoutS" ref="ga9cf6ebe4c9f28cb206fab14984a18d29" args="(CondVar *cp, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chCondWaitTimeoutS </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_cond_var.html">CondVar</a> *&nbsp;</td>
<td class="paramname"> <em>cp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a>&nbsp;</td>
<td class="paramname"> <em>time</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits on the condition variable releasing the mutex lock. </p>
<p>Releases the currently owned mutex, waits on the condition variable, and finally acquires the mutex again. All the sequence is performed atomically. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The invoking thread <b>must</b> have at least one owned mutex on entry. </dd>
<dd>
Exiting the function because a timeout does not re-acquire the mutex, the mutex ownership is lost.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_cond_var.html" title="CondVar structure.">CondVar</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>time</em>&nbsp;</td><td>the number of ticks before the operation timeouts, the special value <code>TIME_INFINITE</code> is allowed. It is not possible to specify zero <code>TIME_IMMEDIATE</code> as timeout specification because it would make no sense in this function. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The wakep mode. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>RDY_OK</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996" title="Signals one thread that is waiting on the condition variable.">chCondSignal()</a></code>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RDY_RESET</em>&nbsp;</td><td>if the condvar was signaled using <code><a class="el" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6" title="Signals all threads that are waiting on the condition variable.">chCondBroadcast()</a></code>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RDY_TIMEOUT</em>&nbsp;</td><td>if the condvar was not signaled within the specified timeout. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chcond_8c_source.html#l00231">231</a> of file <a class="el" href="chcond_8c_source.html">chcond.c</a>.</p>
<p>References <a class="el" href="struct_cond_var.html#a0d320ca091de542fccfebabc7716f666">CondVar::c_queue</a>, <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5">chMtxLockS()</a>, <a class="el" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96">chMtxUnlockS()</a>, <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, <a class="el" href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7">currp</a>, <a class="el" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2">prio_insert()</a>, <a class="el" href="group__scheduler.html#gaf28d5427eeeb8f737cc7db495157780c">RDY_TIMEOUT</a>, and <a class="el" href="group__threads.html#ga286c5b1a6459d654d5794fc17e93c939">THD_STATE_WTCOND</a>.</p>
<p>Referenced by <a class="el" href="group__condvars.html#ga07a0c55ac1002a64e8c7f9b7e3ca1caf">chCondWaitTimeout()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph.png" border="0" usemap="#group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph_map" alt=""></div>
<map name="group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph_map" id="group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph">
<area shape="rect" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="208,77,288,101"/>
<area shape="rect" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="380,125,452,149"/>
<area shape="rect" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="204,29,292,53"/>
<area shape="rect" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification..." alt="" coords="180,199,316,223"/>
<area shape="rect" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986" title="Puts the current thread to sleep into the specified state." alt="" coords="367,173,465,197"/>
<area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="373,29,459,53"/>
<area shape="rect" href="group__internals.html#gafff11bcd31d7dc3d1a0a6c66f3fc6ec9" title="Removes a Thread from a queue and returns it." alt="" coords="384,77,448,101"/>
<area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="515,77,595,101"/>
<area shape="rect" href="group__time.html#ga680d851a74e594cc965101e79891840f" title="Disables a Virtual Timer." alt="" coords="377,269,455,293"/>
<area shape="rect" href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e" title="Enables a virtual timer." alt="" coords="384,221,448,245"/>
</map>
</div>
</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Jul 11 13:13:14 2010 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.3</small></address>
</body>
</html>