gnuk/ChibiOS_2.0.6/docs/html/group__condvars.html

599 lines
47 KiB
HTML
Raw Normal View History

2010-08-10 03:11:02 +00:00
<!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">
2010-11-22 05:53:37 +00:00
<!-- Generated by Doxygen 1.7.1 -->
2010-08-10 03:11:02 +00:00
<div class="navigation" id="top">
<div class="tabs">
2010-11-22 05:53:37 +00:00
<ul class="tablist">
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
2010-08-10 03:11:02 +00:00
<h1>Condition Variables<br/>
<small>
[<a class="el" href="group__synchronization.html">Synchronization</a>]</small>
2010-11-22 05:53:37 +00:00
</h1> </div>
</div>
<div class="contents">
2010-08-10 03:11:02 +00:00
<p><div class="dynheader">
Collaboration diagram for Condition Variables:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<center><table><tr><td><img src="group__condvars.png" border="0" alt="" usemap="#group____condvars"/>
<map name="group____condvars" id="group____condvars">
<area shape="rect" id="node2" href="group__synchronization.html" title="Synchronization" alt="" coords="7,5,105,32"/> </map>
</td></tr></table></center>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">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>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">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>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">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__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> time)</td></tr>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">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__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> time)</td></tr>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">name</td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">name</td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph.png" border="0" usemap="#group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph" alt=""/></div>
<map name="group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph" id="group__condvars_gadddadb68e2a2ce061c7df0d647da9996_cgraph">
<area shape="rect" id="node3" href="group__scheduler.html#gae47a8819a21ef2d521124e76bfb37c95" title="Wakes up a thread." alt="" coords="141,31,240,57"/> <area shape="rect" id="node9" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="151,81,231,108"/> <area shape="rect" id="node5" href="group__debug.html#gac7f8f0653faf2e3a93108ff5333821b7" title="Inserts in the circular debug trace buffer a context switch record." alt="" coords="292,5,372,32"/> <area shape="rect" id="node7" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="289,56,375,83"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<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>, and <a class="el" href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">Thread::rdymsg</a>.</p>
2010-08-10 03:11:02 +00:00
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph.png" border="0" usemap="#group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph" alt=""/></div>
<map name="group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph" id="group__condvars_ga7b9d882c348124fed46a1afc3db6c02c_cgraph">
<area shape="rect" id="node3" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="145,5,231,32"/> <area shape="rect" id="node5" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="148,56,228,83"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph.png" border="0" usemap="#group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph" alt=""/></div>
<map name="group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph" id="group__condvars_ga60c24a8060a884313efe82b8404e77f6_cgraph">
<area shape="rect" id="node3" href="group__condvars.html#ga5cf1f4697985d81ee089b042391df6fc" title="Signals all threads that are waiting on the condition variable." alt="" coords="336,5,445,32"/> <area shape="rect" id="node9" href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20" title="Performs a reschedule if a higher priority thread is runnable." alt="" coords="163,56,280,83"/> <area shape="rect" id="node5" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="503,5,588,32"/> <area shape="rect" id="node7" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="505,56,585,83"/> <area shape="rect" id="node11" href="group__scheduler.html#ga0257cf203e72a766a52059750cb97e6e" title="Switches to the first thread on the runnable queue." alt="" coords="328,56,453,83"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<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>, and <a class="el" href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">Thread::rdymsg</a>.</p>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph.png" border="0" usemap="#group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph" alt=""/></div>
<map name="group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph" id="group__condvars_ga5cf1f4697985d81ee089b042391df6fc_cgraph">
<area shape="rect" id="node3" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="167,5,252,32"/> <area shape="rect" id="node5" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="169,56,249,83"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">msg_t</a> chCondWait </td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph.png" border="0" usemap="#group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph" alt=""/></div>
<map name="group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph" id="group__condvars_ga466f912bc9b09b133fae862993004ffe_cgraph">
<area shape="rect" id="node3" href="group__condvars.html#gab6357d80b01ed8d225ef1e30a66248f9" title="Waits on the condition variable releasing the mutex lock." alt="" coords="135,56,220,83"/> <area shape="rect" id="node5" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="275,31,355,57"/> <area shape="rect" id="node7" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986" title="Puts the current thread to sleep into the specified state." alt="" coords="408,5,509,32"/> <area shape="rect" id="node9" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="423,68,495,95"/> <area shape="rect" id="node11" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="269,132,360,159"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">msg_t</a> chCondWaitS </td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<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="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>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph.png" border="0" usemap="#group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph" alt=""/></div>
<map name="group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph" id="group__condvars_gab6357d80b01ed8d225ef1e30a66248f9_cgraph">
<area shape="rect" id="node3" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="147,123,227,150"/> <area shape="rect" id="node5" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986" title="Puts the current thread to sleep into the specified state." alt="" coords="280,73,381,99"/> <area shape="rect" id="node13" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="295,174,367,201"/> <area shape="rect" id="node15" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="141,22,232,49"/> <area shape="rect" id="node9" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="288,22,373,49"/> <area shape="rect" id="node11" href="group__internals.html#gafff11bcd31d7dc3d1a0a6c66f3fc6ec9" title="Removes a Thread from a queue and returns it." alt="" coords="299,123,363,150"/> <area shape="rect" id="node7" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="429,22,509,49"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">msg_t</a> chCondWaitTimeout </td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph.png" border="0" usemap="#group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph" alt=""/></div>
<map name="group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph" id="group__condvars_ga07a0c55ac1002a64e8c7f9b7e3ca1caf_cgraph">
<area shape="rect" id="node3" href="group__condvars.html#ga9cf6ebe4c9f28cb206fab14984a18d29" title="Waits on the condition variable releasing the mutex lock." alt="" coords="172,81,295,108"/> <area shape="rect" id="node5" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="373,5,453,32"/> <area shape="rect" id="node7" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="532,31,604,57"/> <area shape="rect" id="node9" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="368,107,459,133"/> <area shape="rect" id="node11" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification." alt="" coords="344,157,483,184"/> </map>
2010-08-10 03:11:02 +00:00
</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>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3">msg_t</a> chCondWaitTimeoutS </td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph.png" border="0" usemap="#group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph" alt=""/></div>
<map name="group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph" id="group__condvars_ga9cf6ebe4c9f28cb206fab14984a18d29_cgraph">
<area shape="rect" id="node3" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="208,79,288,106"/> <area shape="rect" id="node13" href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2" title="Inserts a thread into a priority ordered queue." alt="" coords="380,130,452,157"/> <area shape="rect" id="node15" href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="203,29,293,55"/> <area shape="rect" id="node19" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification." alt="" coords="179,206,317,233"/> <area shape="rect" id="node5" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986" title="Puts the current thread to sleep into the specified state." alt="" coords="365,181,467,207"/> <area shape="rect" id="node9" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="373,29,459,55"/> <area shape="rect" id="node11" href="group__internals.html#gafff11bcd31d7dc3d1a0a6c66f3fc6ec9" title="Removes a Thread from a queue and returns it." alt="" coords="384,79,448,106"/> <area shape="rect" id="node7" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="515,79,595,106"/> <area shape="rect" id="node22" href="group__time.html#ga680d851a74e594cc965101e79891840f" title="Disables a Virtual Timer." alt="" coords="377,282,455,309"/> <area shape="rect" id="node24" href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e" title="Enables a virtual timer." alt="" coords="383,231,449,258"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
2010-11-22 05:53:37 +00:00
Generated on Sun Oct 24 2010 09:40:46 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.7.1</small></address>
2010-08-10 03:11:02 +00:00
</body>
</html>