You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							149 lines
						
					
					
						
							9.6 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							149 lines
						
					
					
						
							9.6 KiB
						
					
					
				
								<!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::spin_rw_mutex_v3::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 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 Pages</span></a></li>
							 | 
						|
								  </ul></div>
							 | 
						|
								<div class="tabs">
							 | 
						|
								  <ul>
							 | 
						|
								    <li><a href="annotated.html"><span>Class List</span></a></li>
							 | 
						|
								    <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
							 | 
						|
								    <li><a href="functions.html"><span>Class Members</span></a></li>
							 | 
						|
								  </ul></div>
							 | 
						|
								<div class="nav">
							 | 
						|
								<a class="el" href="a00428.html">tbb</a>::<a class="el" href="a00345.html">spin_rw_mutex_v3</a>::<a class="el" href="a00346.html">scoped_lock</a></div>
							 | 
						|
								<h1>tbb::spin_rw_mutex_v3::scoped_lock Class Reference</h1><!-- doxytag: class="tbb::spin_rw_mutex_v3::scoped_lock" -->The scoped locking pattern.  
							 | 
						|
								<a href="#_details">More...</a>
							 | 
						|
								<p>
							 | 
						|
								<code>#include <spin_rw_mutex.h></code>
							 | 
						|
								<p>
							 | 
						|
								<a href="a00130.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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#d6ea60dee5563f702379bf5e51aa8806">scoped_lock</a> ()</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct lock that has not acquired a mutex.  <a href="#d6ea60dee5563f702379bf5e51aa8806"></a><br></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="42a92d4f8fdde425b111cfa8a9228071"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::scoped_lock" ref="42a92d4f8fdde425b111cfa8a9228071" args="(spin_rw_mutex &m, bool write=true)" -->
							 | 
						|
								 </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#42a92d4f8fdde425b111cfa8a9228071">scoped_lock</a> (<a class="el" href="a00345.html">spin_rw_mutex</a> &m, bool write=true)</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </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="d7eaaa3f2e2c5dc11e7005811b1bdd04"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::~scoped_lock" ref="d7eaaa3f2e2c5dc11e7005811b1bdd04" args="()" -->
							 | 
						|
								 </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#d7eaaa3f2e2c5dc11e7005811b1bdd04">~scoped_lock</a> ()</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </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="b0b646ec5be02a127d159bbb7ca65353"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::acquire" ref="b0b646ec5be02a127d159bbb7ca65353" args="(spin_rw_mutex &m, bool write=true)" -->
							 | 
						|
								void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#b0b646ec5be02a127d159bbb7ca65353">acquire</a> (<a class="el" href="a00345.html">spin_rw_mutex</a> &m, bool write=true)</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">Acquire lock on given mutex. <br></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#3f0b1e3f2efab63336400348bd070226">upgrade_to_writer</a> ()</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">Upgrade reader to become a writer.  <a href="#3f0b1e3f2efab63336400348bd070226"></a><br></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="61b14d00a78185c9b2d206ebfc379124"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::release" ref="61b14d00a78185c9b2d206ebfc379124" args="()" -->
							 | 
						|
								void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#61b14d00a78185c9b2d206ebfc379124">release</a> ()</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">Release lock. <br></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c2c2c38a08cb9080e87099fac3e5bc94"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::downgrade_to_reader" ref="c2c2c38a08cb9080e87099fac3e5bc94" args="()" -->
							 | 
						|
								bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#c2c2c38a08cb9080e87099fac3e5bc94">downgrade_to_reader</a> ()</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">Downgrade writer to become a reader. <br></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9879626968d9b9a04cd2ec0fb2e84ae1"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::try_acquire" ref="9879626968d9b9a04cd2ec0fb2e84ae1" args="(spin_rw_mutex &m, bool write=true)" -->
							 | 
						|
								bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#9879626968d9b9a04cd2ec0fb2e84ae1">try_acquire</a> (<a class="el" href="a00345.html">spin_rw_mutex</a> &m, bool write=true)</td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">Try acquire lock on given mutex. <br></td></tr>
							 | 
						|
								<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d96d1a1fcc3d79ef3e5c06a53b8ffeaa"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::mutex" ref="d96d1a1fcc3d79ef3e5c06a53b8ffeaa" args="" -->
							 | 
						|
								<a class="el" href="a00345.html">spin_rw_mutex</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#d96d1a1fcc3d79ef3e5c06a53b8ffeaa">mutex</a></td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">The pointer to the current mutex that is held, or NULL if no mutex is held. <br></td></tr>
							 | 
						|
								<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00346.html#6b5a7c3c67a36b05c4df8410d32627d8">is_writer</a></td></tr>
							 | 
						|
								
							 | 
						|
								<tr><td class="mdescLeft"> </td><td class="mdescRight">If mutex!=NULL, then is_writer is true if holding a writer lock, false if holding a reader lock.  <a href="#6b5a7c3c67a36b05c4df8410d32627d8"></a><br></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><h2>Constructor & Destructor Documentation</h2>
							 | 
						|
								<a class="anchor" name="d6ea60dee5563f702379bf5e51aa8806"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::scoped_lock" ref="d6ea60dee5563f702379bf5e51aa8806" args="()" -->
							 | 
						|
								<div class="memitem">
							 | 
						|
								<div class="memproto">
							 | 
						|
								      <table class="memname">
							 | 
						|
								        <tr>
							 | 
						|
								          <td class="memname">tbb::spin_rw_mutex_v3::scoped_lock::scoped_lock           </td>
							 | 
						|
								          <td>(</td>
							 | 
						|
								          <td class="paramname">          </td>
							 | 
						|
								          <td> ) </td>
							 | 
						|
								          <td width="100%"><code> [inline]</code></td>
							 | 
						|
								        </tr>
							 | 
						|
								      </table>
							 | 
						|
								</div>
							 | 
						|
								<div class="memdoc">
							 | 
						|
								
							 | 
						|
								<p>
							 | 
						|
								Construct lock that has not acquired a mutex. 
							 | 
						|
								<p>
							 | 
						|
								Equivalent to zero-initialization of *this. 
							 | 
						|
								</div>
							 | 
						|
								</div><p>
							 | 
						|
								<hr><h2>Member Function Documentation</h2>
							 | 
						|
								<a class="anchor" name="3f0b1e3f2efab63336400348bd070226"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::upgrade_to_writer" ref="3f0b1e3f2efab63336400348bd070226" args="()" -->
							 | 
						|
								<div class="memitem">
							 | 
						|
								<div class="memproto">
							 | 
						|
								      <table class="memname">
							 | 
						|
								        <tr>
							 | 
						|
								          <td class="memname">bool tbb::spin_rw_mutex_v3::scoped_lock::upgrade_to_writer           </td>
							 | 
						|
								          <td>(</td>
							 | 
						|
								          <td class="paramname">          </td>
							 | 
						|
								          <td> ) </td>
							 | 
						|
								          <td width="100%"><code> [inline]</code></td>
							 | 
						|
								        </tr>
							 | 
						|
								      </table>
							 | 
						|
								</div>
							 | 
						|
								<div class="memdoc">
							 | 
						|
								
							 | 
						|
								<p>
							 | 
						|
								Upgrade reader to become a writer. 
							 | 
						|
								<p>
							 | 
						|
								Returns whether the upgrade happened without releasing and re-acquiring the lock 
							 | 
						|
								</div>
							 | 
						|
								</div><p>
							 | 
						|
								<hr><h2>Member Data Documentation</h2>
							 | 
						|
								<a class="anchor" name="6b5a7c3c67a36b05c4df8410d32627d8"></a><!-- doxytag: member="tbb::spin_rw_mutex_v3::scoped_lock::is_writer" ref="6b5a7c3c67a36b05c4df8410d32627d8" args="" -->
							 | 
						|
								<div class="memitem">
							 | 
						|
								<div class="memproto">
							 | 
						|
								      <table class="memname">
							 | 
						|
								        <tr>
							 | 
						|
								          <td class="memname">bool <a class="el" href="a00346.html#6b5a7c3c67a36b05c4df8410d32627d8">tbb::spin_rw_mutex_v3::scoped_lock::is_writer</a><code> [protected]</code>          </td>
							 | 
						|
								        </tr>
							 | 
						|
								      </table>
							 | 
						|
								</div>
							 | 
						|
								<div class="memdoc">
							 | 
						|
								
							 | 
						|
								<p>
							 | 
						|
								If mutex!=NULL, then is_writer is true if holding a writer lock, false if holding a reader lock. 
							 | 
						|
								<p>
							 | 
						|
								Not defined if not holding a lock. 
							 | 
						|
								</div>
							 | 
						|
								</div><p>
							 | 
						|
								<hr>The documentation for this class was generated from the following file:<ul>
							 | 
						|
								<li>spin_rw_mutex.h</ul>
							 | 
						|
								<hr>
							 | 
						|
								<p></p>
							 | 
						|
								Copyright © 2005-2013 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.
							 |