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.

123 lines
7.8 KiB

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  3. <title>tbb::queuing_rw_mutex::scoped_lock Class Reference</title>
  4. <link href="doxygen.css" rel="stylesheet" type="text/css">
  5. <link href="tabs.css" rel="stylesheet" type="text/css">
  6. </head><body>
  7. <!-- Generated by Doxygen 1.4.7 -->
  8. <div class="tabs">
  9. <ul>
  10. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  11. <li><a href="modules.html"><span>Modules</span></a></li>
  12. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  13. <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
  14. <li><a href="files.html"><span>Files</span></a></li>
  15. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  16. </ul></div>
  17. <div class="tabs">
  18. <ul>
  19. <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
  20. <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
  21. <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  22. </ul></div>
  23. <div class="nav">
  24. <a class="el" href="a00428.html">tbb</a>::<a class="el" href="a00328.html">queuing_rw_mutex</a>::<a class="el" href="a00329.html">scoped_lock</a></div>
  25. <h1>tbb::queuing_rw_mutex::scoped_lock Class Reference</h1><!-- doxytag: class="tbb::queuing_rw_mutex::scoped_lock" -->The scoped locking pattern.
  26. <a href="#_details">More...</a>
  27. <p>
  28. <code>#include &lt;queuing_rw_mutex.h&gt;</code>
  29. <p>
  30. <a href="a00115.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
  31. <tr><td></td></tr>
  32. <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
  33. <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#c62e365be7bcbba091c9ea7454a4d22c">scoped_lock</a> ()</td></tr>
  34. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct lock that has not acquired a mutex. <a href="#c62e365be7bcbba091c9ea7454a4d22c"></a><br></td></tr>
  35. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fbb8798792d3aebb136c46fc63d2529e"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::scoped_lock" ref="fbb8798792d3aebb136c46fc63d2529e" args="(queuing_rw_mutex &amp;m, bool write=true)" -->
  36. &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#fbb8798792d3aebb136c46fc63d2529e">scoped_lock</a> (<a class="el" href="a00328.html">queuing_rw_mutex</a> &amp;m, bool write=true)</td></tr>
  37. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Acquire lock on given mutex. <br></td></tr>
  38. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="32c7d67a660d23ebbaab1a1d2826d31a"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::~scoped_lock" ref="32c7d67a660d23ebbaab1a1d2826d31a" args="()" -->
  39. &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#32c7d67a660d23ebbaab1a1d2826d31a">~scoped_lock</a> ()</td></tr>
  40. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release lock (if lock is held). <br></td></tr>
  41. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a8dd5ab8686e76de21587544dbb681e0"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::acquire" ref="a8dd5ab8686e76de21587544dbb681e0" args="(queuing_rw_mutex &amp;m, bool write=true)" -->
  42. void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#a8dd5ab8686e76de21587544dbb681e0">acquire</a> (<a class="el" href="a00328.html">queuing_rw_mutex</a> &amp;m, bool write=true)</td></tr>
  43. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Acquire lock on given mutex. <br></td></tr>
  44. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2e4ff6c9ec2fee6682f95290d1f42baa"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::try_acquire" ref="2e4ff6c9ec2fee6682f95290d1f42baa" args="(queuing_rw_mutex &amp;m, bool write=true)" -->
  45. bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#2e4ff6c9ec2fee6682f95290d1f42baa">try_acquire</a> (<a class="el" href="a00328.html">queuing_rw_mutex</a> &amp;m, bool write=true)</td></tr>
  46. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Acquire lock on given mutex if free (i.e. non-blocking). <br></td></tr>
  47. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="67ae221109ddc69510ab593874e435d4"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::release" ref="67ae221109ddc69510ab593874e435d4" args="()" -->
  48. void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#67ae221109ddc69510ab593874e435d4">release</a> ()</td></tr>
  49. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release lock. <br></td></tr>
  50. <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#11ba1da4a722c9e6f73339a52c487e82">upgrade_to_writer</a> ()</td></tr>
  51. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Upgrade reader to become a writer. <a href="#11ba1da4a722c9e6f73339a52c487e82"></a><br></td></tr>
  52. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0d2f93edf7b15ec4bcee138823220c52"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::downgrade_to_reader" ref="0d2f93edf7b15ec4bcee138823220c52" args="()" -->
  53. bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00329.html#0d2f93edf7b15ec4bcee138823220c52">downgrade_to_reader</a> ()</td></tr>
  54. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Downgrade writer to become a reader. <br></td></tr>
  55. </table>
  56. <hr><a name="_details"></a><h2>Detailed Description</h2>
  57. The scoped locking pattern.
  58. <p>
  59. It helps to avoid the common problem of forgetting to release lock. It also nicely provides the "node" for queuing locks.
  60. <p>
  61. <hr><h2>Constructor &amp; Destructor Documentation</h2>
  62. <a class="anchor" name="c62e365be7bcbba091c9ea7454a4d22c"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::scoped_lock" ref="c62e365be7bcbba091c9ea7454a4d22c" args="()" -->
  63. <div class="memitem">
  64. <div class="memproto">
  65. <table class="memname">
  66. <tr>
  67. <td class="memname">tbb::queuing_rw_mutex::scoped_lock::scoped_lock </td>
  68. <td>(</td>
  69. <td class="paramname"> </td>
  70. <td>&nbsp;)&nbsp;</td>
  71. <td width="100%"><code> [inline]</code></td>
  72. </tr>
  73. </table>
  74. </div>
  75. <div class="memdoc">
  76. <p>
  77. Construct lock that has not acquired a mutex.
  78. <p>
  79. Equivalent to zero-initialization of *this.
  80. </div>
  81. </div><p>
  82. <hr><h2>Member Function Documentation</h2>
  83. <a class="anchor" name="11ba1da4a722c9e6f73339a52c487e82"></a><!-- doxytag: member="tbb::queuing_rw_mutex::scoped_lock::upgrade_to_writer" ref="11ba1da4a722c9e6f73339a52c487e82" args="()" -->
  84. <div class="memitem">
  85. <div class="memproto">
  86. <table class="memname">
  87. <tr>
  88. <td class="memname">bool tbb::queuing_rw_mutex::scoped_lock::upgrade_to_writer </td>
  89. <td>(</td>
  90. <td class="paramname"> </td>
  91. <td>&nbsp;)&nbsp;</td>
  92. <td width="100%"></td>
  93. </tr>
  94. </table>
  95. </div>
  96. <div class="memdoc">
  97. <p>
  98. Upgrade reader to become a writer.
  99. <p>
  100. Returns whether the upgrade happened without releasing and re-acquiring the lock
  101. </div>
  102. </div><p>
  103. <hr>The documentation for this class was generated from the following file:<ul>
  104. <li>queuing_rw_mutex.h</ul>
  105. <hr>
  106. <p></p>
  107. Copyright &copy; 2005-2013 Intel Corporation. All Rights Reserved.
  108. <p></p>
  109. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  110. registered trademarks or trademarks of Intel Corporation or its
  111. subsidiaries in the United States and other countries.
  112. <p></p>
  113. * Other names and brands may be claimed as the property of others.