Update-Installer/external/TinyThread/doc/html/classtthread_1_1fast__mutex.html

130 lines
8 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>TinyThread++: fast_mutex Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespacetthread.html">tthread</a>::<a class="el" href="classtthread_1_1fast__mutex.html">fast_mutex</a>
</div>
</div>
<div class="contents">
<h1>fast_mutex Class Reference</h1><!-- doxytag: class="tthread::fast_mutex" -->
<p>Fast mutex class.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="fast__mutex_8h_source.html">fast_mutex.h</a>&gt;</code></p>
<p><a href="classtthread_1_1fast__mutex-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aed9ff6c4d30b4fe2775a15c6778d96f8"></a><!-- doxytag: member="tthread::fast_mutex::fast_mutex" ref="aed9ff6c4d30b4fe2775a15c6778d96f8" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1fast__mutex.html#aed9ff6c4d30b4fe2775a15c6778d96f8">fast_mutex</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5eea296c19289a40d7b76df35ecf72a7"></a><!-- doxytag: member="tthread::fast_mutex::~fast_mutex" ref="a5eea296c19289a40d7b76df35ecf72a7" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1fast__mutex.html#a5eea296c19289a40d7b76df35ecf72a7">~fast_mutex</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1fast__mutex.html#aa81aed607133209dade63a226818224d">lock</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Lock the mutex. <a href="#aa81aed607133209dade63a226818224d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1fast__mutex.html#aa24a64f788f142df670c3abc809d32b6">try_lock</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Try to lock the mutex. <a href="#aa24a64f788f142df670c3abc809d32b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1fast__mutex.html#a9278be8203e1c42e2619179882ae4403">unlock</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unlock the mutex. <a href="#a9278be8203e1c42e2619179882ae4403"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Fast mutex class. </p>
<p>This is a mutual exclusion object for synchronizing access to shared memory areas for several threads. It is similar to the <a class="el" href="classtthread_1_1mutex.html" title="Mutex class.">tthread::mutex</a> class, but instead of using system level functions, it is implemented as an atomic spin lock with very low CPU overhead.</p>
<p>The <code><a class="el" href="classtthread_1_1fast__mutex.html" title="Fast mutex class.">fast_mutex</a></code> class is NOT compatible with the <code><a class="el" href="classtthread_1_1condition__variable.html" title="Condition variable class.">condition_variable</a></code> class (however, it IS compatible with the <code><a class="el" href="classtthread_1_1lock__guard.html" title="Lock guard class.">lock_guard</a></code> class). It should also be noted that the <code><a class="el" href="classtthread_1_1fast__mutex.html" title="Fast mutex class.">fast_mutex</a></code> class typically does not provide as accurate thread scheduling as a the standard <code>mutex</code> class does.</p>
<p>Because of the limitations of the class, it should only be used in situations where the mutex needs to be locked/unlocked very frequently.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The "fast" version of this class relies on inline assembler language, which is currently only supported for 32/64-bit Intel x86/AMD64 and PowerPC architectures on a limited number of compilers (GNU g++ and MS Visual C++). For other architectures/compilers, system functions are used instead. </dd></dl>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa81aed607133209dade63a226818224d"></a><!-- doxytag: member="tthread::fast_mutex::lock" ref="aa81aed607133209dade63a226818224d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void lock </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Lock the mutex. </p>
<p>The method will block the calling thread until a lock on the mutex can be obtained. The mutex remains locked until <code><a class="el" href="classtthread_1_1fast__mutex.html#a9278be8203e1c42e2619179882ae4403" title="Unlock the mutex.">unlock()</a></code> is called. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classtthread_1_1lock__guard.html" title="Lock guard class.">lock_guard</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aa24a64f788f142df670c3abc809d32b6"></a><!-- doxytag: member="tthread::fast_mutex::try_lock" ref="aa24a64f788f142df670c3abc809d32b6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool try_lock </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Try to lock the mutex. </p>
<p>The method will try to lock the mutex. If it fails, the function will return immediately (non-blocking). </p>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if the lock was acquired, or <code>false</code> if the lock could not be acquired. </dd></dl>
</div>
</div>
<a class="anchor" id="a9278be8203e1c42e2619179882ae4403"></a><!-- doxytag: member="tthread::fast_mutex::unlock" ref="a9278be8203e1c42e2619179882ae4403" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void unlock </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unlock the mutex. </p>
<p>If any threads are waiting for the lock on this mutex, one of them will be unblocked. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="fast__mutex_8h_source.html">fast_mutex.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Oct 1 21:49:33 2010 for TinyThread++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>