gnuk/ChibiOS_2.0.8/docs/html/classchibios__rt_1_1_mutex.html

270 lines
15 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: chibios_rt::Mutex Class Reference</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 class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
2010-11-22 05:53:37 +00:00
<div class="tabs2">
<ul class="tablist">
2010-08-10 03:11:02 +00:00
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
</ul>
</div>
2010-11-22 05:53:37 +00:00
<div class="navpath">
<ul>
<li><b>chibios_rt</b> </li>
<li><a class="el" href="classchibios__rt_1_1_mutex.html">chibios_rt::Mutex</a> </li>
</ul>
2010-08-10 03:11:02 +00:00
</div>
</div>
2010-11-22 05:53:37 +00:00
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
<h1>chibios_rt::Mutex Class Reference</h1> </div>
</div>
2010-08-10 03:11:02 +00:00
<div class="contents">
2010-11-22 05:53:37 +00:00
<!-- doxytag: class="chibios_rt::Mutex" -->
2010-08-10 03:11:02 +00:00
<p>Class encapsulating a mutex.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="ch_8hpp_source.html">ch.hpp</a>&gt;</code></p>
2010-11-22 05:53:37 +00:00
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchibios__rt_1_1_mutex.html#a00b2ff557451955a905ecdca2855389b">Mutex</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classchibios__rt_1_1_mutex.html" title="Class encapsulating a mutex.">Mutex</a> constructor. <a href="#a00b2ff557451955a905ecdca2855389b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchibios__rt_1_1_mutex.html#a787ecfd207fd25760a3c07517b69c148">TryLock</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tries a lock operation on the mutex. <a href="#a787ecfd207fd25760a3c07517b69c148"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchibios__rt_1_1_mutex.html#a1726d7244983f7be74fcfa9cfb63745f">Lock</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Locks the mutex. <a href="#a1726d7244983f7be74fcfa9cfb63745f"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchibios__rt_1_1_mutex.html#a03150e8fa423f7e042661d350d238b84">Unlock</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unlocks the mutex. <a href="#a03150e8fa423f7e042661d350d238b84"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchibios__rt_1_1_mutex.html#ac149b2a2e188a1c00d1726671338b39d">UnlockAll</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unlocks all the mutexes owned by the invoking thread. <a href="#ac149b2a2e188a1c00d1726671338b39d"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__mutexes.html#ga9b2dfabf6db35faa7fd04ea30834012d">struct::Mutex</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2">mutex</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Embedded <code><a class="el" href="struct_mutex.html" title="Mutex structure.">Mutex</a></code> structure. <a href="#a6fe411dfe88642cc7c379a59ea931da2"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Class encapsulating a mutex. </p>
<p>Definition at line <a class="el" href="ch_8hpp_source.html#l00361">361</a> of file <a class="el" href="ch_8hpp_source.html">ch.hpp</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a00b2ff557451955a905ecdca2855389b"></a><!-- doxytag: member="chibios_rt::Mutex::Mutex" ref="a00b2ff557451955a905ecdca2855389b" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Mutex::Mutex </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classchibios__rt_1_1_mutex.html" title="Class encapsulating a mutex.">Mutex</a> constructor. </p>
<p>The embedded <code><a class="el" href="struct_mutex.html" title="Mutex structure.">Mutex</a></code> structure is initialized. </p>
<p>Definition at line <a class="el" href="ch_8cpp_source.html#l00205">205</a> of file <a class="el" href="ch_8cpp_source.html">ch.cpp</a>.</p>
<p>References <a class="el" href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6">chMtxInit()</a>, and <a class="el" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2">mutex</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="classchibios__rt_1_1_mutex_a00b2ff557451955a905ecdca2855389b_cgraph.png" border="0" usemap="#classchibios__rt_1_1_mutex_a00b2ff557451955a905ecdca2855389b_cgraph" alt=""/></div>
<map name="classchibios__rt_1_1_mutex_a00b2ff557451955a905ecdca2855389b_cgraph" id="classchibios__rt_1_1_mutex_a00b2ff557451955a905ecdca2855389b_cgraph">
<area shape="rect" id="node3" href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6" title="Initializes s Mutex structure." alt="" coords="192,5,256,32"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a787ecfd207fd25760a3c07517b69c148"></a><!-- doxytag: member="chibios_rt::Mutex::TryLock" ref="a787ecfd207fd25760a3c07517b69c148" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Mutex::TryLock </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Tries a lock operation on the mutex. </p>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>TRUE</em>&nbsp;</td><td>if the mutex was successfully acquired </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FALSE</em>&nbsp;</td><td>if the lock attempt failed. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="ch_8cpp_source.html#l00210">210</a> of file <a class="el" href="ch_8cpp_source.html">ch.cpp</a>.</p>
<p>References <a class="el" href="group__mutexes.html#gaada14e216460dc55e1816234168cf95c">chMtxTryLock()</a>, and <a class="el" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2">mutex</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="classchibios__rt_1_1_mutex_a787ecfd207fd25760a3c07517b69c148_cgraph.png" border="0" usemap="#classchibios__rt_1_1_mutex_a787ecfd207fd25760a3c07517b69c148_cgraph" alt=""/></div>
<map name="classchibios__rt_1_1_mutex_a787ecfd207fd25760a3c07517b69c148_cgraph" id="classchibios__rt_1_1_mutex_a787ecfd207fd25760a3c07517b69c148_cgraph">
<area shape="rect" id="node3" href="group__mutexes.html#gaada14e216460dc55e1816234168cf95c" title="Tries to lock a mutex." alt="" coords="203,5,293,32"/> <area shape="rect" id="node5" href="group__mutexes.html#gadbf0bd4a36b1f7e33ee41939df32ab78" title="Tries to lock a mutex." alt="" coords="343,5,439,32"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="a1726d7244983f7be74fcfa9cfb63745f"></a><!-- doxytag: member="chibios_rt::Mutex::Lock" ref="a1726d7244983f7be74fcfa9cfb63745f" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Mutex::Lock </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Locks the mutex. </p>
<p>Performs a lock operation on the mutex, if the mutex is already locked then the thread enters the mutex priority queue and waits. </p>
<p>Definition at line <a class="el" href="ch_8cpp_source.html#l00215">215</a> of file <a class="el" href="ch_8cpp_source.html">ch.cpp</a>.</p>
<p>References <a class="el" href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba">chMtxLock()</a>, and <a class="el" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2">mutex</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="classchibios__rt_1_1_mutex_a1726d7244983f7be74fcfa9cfb63745f_cgraph.png" border="0" usemap="#classchibios__rt_1_1_mutex_a1726d7244983f7be74fcfa9cfb63745f_cgraph" alt=""/></div>
<map name="classchibios__rt_1_1_mutex_a1726d7244983f7be74fcfa9cfb63745f_cgraph" id="classchibios__rt_1_1_mutex_a1726d7244983f7be74fcfa9cfb63745f_cgraph">
<area shape="rect" id="node3" href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba" title="Locks the specified mutex." alt="" coords="187,5,261,32"/> <area shape="rect" id="node5" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="311,5,391,32"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="a03150e8fa423f7e042661d350d238b84"></a><!-- doxytag: member="chibios_rt::Mutex::Unlock" ref="a03150e8fa423f7e042661d350d238b84" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Mutex::Unlock </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unlocks the mutex. </p>
<p>Performs an unlock operation on the mutex, the next waiting thread, if any, is resumed and locks the mutex. </p>
<p>Definition at line <a class="el" href="ch_8cpp_source.html#l00220">220</a> of file <a class="el" href="ch_8cpp_source.html">ch.cpp</a>.</p>
<p>References <a class="el" href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669">chMtxUnlock()</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="classchibios__rt_1_1_mutex_a03150e8fa423f7e042661d350d238b84_cgraph.png" border="0" usemap="#classchibios__rt_1_1_mutex_a03150e8fa423f7e042661d350d238b84_cgraph" alt=""/></div>
<map name="classchibios__rt_1_1_mutex_a03150e8fa423f7e042661d350d238b84_cgraph" id="classchibios__rt_1_1_mutex_a03150e8fa423f7e042661d350d238b84_cgraph">
<area shape="rect" id="node3" href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="197,31,280,57"/> <area shape="rect" id="node5" href="group__scheduler.html#gae47a8819a21ef2d521124e76bfb37c95" title="Wakes up a thread." alt="" coords="328,5,427,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="337,56,417,83"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="ac149b2a2e188a1c00d1726671338b39d"></a><!-- doxytag: member="chibios_rt::Mutex::UnlockAll" ref="ac149b2a2e188a1c00d1726671338b39d" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void chibios_rt::Mutex::UnlockAll </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unlocks all the mutexes owned by the invoking thread. </p>
<p>This operation is <b>MUCH MORE</b> efficient than releasing the mutexes one by one and not just because the call overhead, this function does not have any overhead related to the priority inheritance mechanism. </p>
</div>
</div>
<hr/><h2>Field Documentation</h2>
<a class="anchor" id="a6fe411dfe88642cc7c379a59ea931da2"></a><!-- doxytag: member="chibios_rt::Mutex::mutex" ref="a6fe411dfe88642cc7c379a59ea931da2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct ::<a class="el" href="classchibios__rt_1_1_mutex.html">Mutex</a> <a class="el" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2">chibios_rt::Mutex::mutex</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Embedded <code><a class="el" href="struct_mutex.html" title="Mutex structure.">Mutex</a></code> structure. </p>
<p>Definition at line <a class="el" href="ch_8hpp_source.html#l00366">366</a> of file <a class="el" href="ch_8hpp_source.html">ch.hpp</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_mutex.html#a1726d7244983f7be74fcfa9cfb63745f">Lock()</a>, <a class="el" href="classchibios__rt_1_1_mutex.html#a00b2ff557451955a905ecdca2855389b">Mutex()</a>, and <a class="el" href="classchibios__rt_1_1_mutex.html#a787ecfd207fd25760a3c07517b69c148">TryLock()</a>.</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
2010-11-30 04:54:43 +00:00
Generated on Sun Nov 28 2010 14:09:59 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>