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

69 lines
3.7 KiB
HTML
Raw 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++: lock_guard&lt; T &gt; Class Template 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_1lock__guard.html">lock_guard</a>
</div>
</div>
<div class="contents">
<h1>lock_guard&lt; T &gt; Class Template Reference</h1><!-- doxytag: class="tthread::lock_guard" -->
<p>Lock guard class.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="tinythread_8h_source.html">tinythread.h</a>&gt;</code></p>
<p><a href="classtthread_1_1lock__guard-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="a2c5fd14427acb035def5201e4cfd4540"></a><!-- doxytag: member="tthread::lock_guard::lock_guard" ref="a2c5fd14427acb035def5201e4cfd4540" args="(mutex_type &amp;aMutex)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1lock__guard.html#a2c5fd14427acb035def5201e4cfd4540">lock_guard</a> (mutex_type &amp;aMutex)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The constructor locks the mutex. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa54999fb933a139807d39ed05e97aa6d"></a><!-- doxytag: member="tthread::lock_guard::~lock_guard" ref="aa54999fb933a139807d39ed05e97aa6d" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1lock__guard.html#aa54999fb933a139807d39ed05e97aa6d">~lock_guard</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor unlocks the mutex. <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class T&gt;<br/>
class tthread::lock_guard&lt; T &gt;</h3>
<p>Lock guard class. </p>
<p>The constructor locks the mutex, and the destructor unlocks the mutex, so the mutex will automatically be unlocked when the lock guard goes out of scope. Example usage: </p>
<div class="fragment"><pre class="fragment"> mutex m;
<span class="keywordtype">int</span> counter;
<span class="keywordtype">void</span> increment()
{
lock_guard&lt;mutex&gt; guard(m);
++ counter;
}
</pre></div> <hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="tinythread_8h_source.html">tinythread.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Oct 1 21:49:34 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>