blob: 609542c62014df527ce2265bdb61bdea91e0ca1d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>tbb::mutex::scoped_lock Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="a00267.html">tbb</a>::<a class="el" href="a00172.html">mutex</a>::<a class="el" href="a00173.html">scoped_lock</a></div>
<h1>tbb::mutex::scoped_lock Class Reference</h1><!-- doxytag: class="tbb::mutex::scoped_lock" -->The scoped locking pattern.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="a00362.html">mutex.h</a>&gt;</code>
<p>
<a href="a00035.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1d403ae51b484df5d86d85ae38f11e6e"></a><!-- doxytag: member="tbb::mutex::scoped_lock::scoped_lock" ref="1d403ae51b484df5d86d85ae38f11e6e" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00173.html#1d403ae51b484df5d86d85ae38f11e6e">scoped_lock</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct lock that has not acquired a mutex. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="605a6b9af0f8cdabdf81825e0de99600"></a><!-- doxytag: member="tbb::mutex::scoped_lock::scoped_lock" ref="605a6b9af0f8cdabdf81825e0de99600" args="(mutex &amp;mutex)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00173.html#605a6b9af0f8cdabdf81825e0de99600">scoped_lock</a> (<a class="el" href="a00172.html">mutex</a> &amp;<a class="el" href="a00172.html">mutex</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Acquire lock on given mutex. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0ebbbecaf4311e9df7362cb76ceaa368"></a><!-- doxytag: member="tbb::mutex::scoped_lock::~scoped_lock" ref="0ebbbecaf4311e9df7362cb76ceaa368" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00173.html#0ebbbecaf4311e9df7362cb76ceaa368">~scoped_lock</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release lock (if lock is held). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="862e022841cdc522e4296a5533b22efd"></a><!-- doxytag: member="tbb::mutex::scoped_lock::acquire" ref="862e022841cdc522e4296a5533b22efd" args="(mutex &amp;mutex)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00173.html#862e022841cdc522e4296a5533b22efd">acquire</a> (<a class="el" href="a00172.html">mutex</a> &amp;<a class="el" href="a00172.html">mutex</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Acquire lock on given mutex. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="591e0c49b82bcedffcbe0923f1b915ec"></a><!-- doxytag: member="tbb::mutex::scoped_lock::try_acquire" ref="591e0c49b82bcedffcbe0923f1b915ec" args="(mutex &amp;mutex)" -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00173.html#591e0c49b82bcedffcbe0923f1b915ec">try_acquire</a> (<a class="el" href="a00172.html">mutex</a> &amp;<a class="el" href="a00172.html">mutex</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Try acquire lock on given mutex. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0d51d18cd99df3b2e93bf07378d0992c"></a><!-- doxytag: member="tbb::mutex::scoped_lock::release" ref="0d51d18cd99df3b2e93bf07378d0992c" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00173.html#0d51d18cd99df3b2e93bf07378d0992c">release</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release lock. <br></td></tr>
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="93062a14ad2e50e2b7b485b913170779"></a><!-- doxytag: member="tbb::mutex::scoped_lock::mutex" ref="93062a14ad2e50e2b7b485b913170779" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><b>mutex</b></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The scoped locking pattern.
<p>
It helps to avoid the common problem of forgetting to release lock. It also nicely provides the "node" for queuing locks.
<p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a00362.html">mutex.h</a></ul>
<hr>
<p></p>
Copyright &copy; 2005-2010 Intel Corporation. All Rights Reserved.
<p></p>
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
<p></p>
* Other names and brands may be claimed as the property of others.