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.

167 lines
11 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.4"/>
  7. <title>tbb::mutex Class Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  15. <!-- end header part -->
  16. <!-- Generated by Doxygen 1.8.4 -->
  17. <div id="navrow1" class="tabs">
  18. <ul class="tablist">
  19. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  20. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  21. <li><a href="modules.html"><span>Modules</span></a></li>
  22. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  23. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  24. <li><a href="files.html"><span>Files</span></a></li>
  25. </ul>
  26. </div>
  27. <div id="navrow2" class="tabs2">
  28. <ul class="tablist">
  29. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  30. <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
  31. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  32. </ul>
  33. </div>
  34. <div id="nav-path" class="navpath">
  35. <ul>
  36. <li class="navelem"><a class="el" href="a00222.html">tbb</a></li><li class="navelem"><a class="el" href="a00081.html">mutex</a></li> </ul>
  37. </div>
  38. </div><!-- top -->
  39. <div class="header">
  40. <div class="summary">
  41. <a href="#nested-classes">Classes</a> &#124;
  42. <a href="#pub-types">Public Types</a> &#124;
  43. <a href="#pub-methods">Public Member Functions</a> &#124;
  44. <a href="#pub-static-attribs">Static Public Attributes</a> &#124;
  45. <a href="#friends">Friends</a> &#124;
  46. <a href="a00258.html">List of all members</a> </div>
  47. <div class="headertitle">
  48. <div class="title">tbb::mutex Class Reference<div class="ingroups"><a class="el" href="a00237.html">Synchronization</a></div></div> </div>
  49. </div><!--header-->
  50. <div class="contents">
  51. <p>Wrapper around the platform's native reader-writer lock.
  52. <a href="a00081.html#details">More...</a></p>
  53. <p><code>#include &lt;mutex.h&gt;</code></p>
  54. <table class="memberdecls">
  55. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
  56. Classes</h2></td></tr>
  57. <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html">scoped_lock</a></td></tr>
  58. <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The scoped locking pattern. <a href="a00116.html#details">More...</a><br/></td></tr>
  59. <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
  60. </table><table class="memberdecls">
  61. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
  62. Public Types</h2></td></tr>
  63. <tr class="memitem:ad35737cbe356d6814f59abba680ab067"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><b>state_t</b> { <b>INITIALIZED</b> =0x1234,
  64. <b>DESTROYED</b> =0x789A,
  65. <b>HELD</b> =0x56CD
  66. }</td></tr>
  67. <tr class="separator:ad35737cbe356d6814f59abba680ab067"><td class="memSeparator" colspan="2">&#160;</td></tr>
  68. <tr class="memitem:abbe0cd12246121753ace00a5a12a90b0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abbe0cd12246121753ace00a5a12a90b0"></a>
  69. typedef LPCRITICAL_SECTION&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00081.html#abbe0cd12246121753ace00a5a12a90b0">native_handle_type</a></td></tr>
  70. <tr class="memdesc:abbe0cd12246121753ace00a5a12a90b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return native_handle. <br/></td></tr>
  71. <tr class="separator:abbe0cd12246121753ace00a5a12a90b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  72. <tr class="memitem:a0d992511dfc6f47295b10eb7fc0813d4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d992511dfc6f47295b10eb7fc0813d4"></a>
  73. typedef pthread_mutex_t *&#160;</td><td class="memItemRight" valign="bottom"><b>native_handle_type</b></td></tr>
  74. <tr class="separator:a0d992511dfc6f47295b10eb7fc0813d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. </table><table class="memberdecls">
  76. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  77. Public Member Functions</h2></td></tr>
  78. <tr class="memitem:ad1b280c954ffc8b8b3e63e4ee4144035"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1b280c954ffc8b8b3e63e4ee4144035"></a>
  79. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00081.html#ad1b280c954ffc8b8b3e63e4ee4144035">mutex</a> ()</td></tr>
  80. <tr class="memdesc:ad1b280c954ffc8b8b3e63e4ee4144035"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct unacquired mutex. <br/></td></tr>
  81. <tr class="separator:ad1b280c954ffc8b8b3e63e4ee4144035"><td class="memSeparator" colspan="2">&#160;</td></tr>
  82. <tr class="memitem:a95ff02ee699b34696001db4003c11a3a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a95ff02ee699b34696001db4003c11a3a"></a>
  83. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00081.html#a95ff02ee699b34696001db4003c11a3a">lock</a> ()</td></tr>
  84. <tr class="memdesc:a95ff02ee699b34696001db4003c11a3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire lock. <br/></td></tr>
  85. <tr class="separator:a95ff02ee699b34696001db4003c11a3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  86. <tr class="memitem:a480283933106941125717499f9c5ad42"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00081.html#a480283933106941125717499f9c5ad42">try_lock</a> ()</td></tr>
  87. <tr class="memdesc:a480283933106941125717499f9c5ad42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try acquiring lock (non-blocking) <a href="#a480283933106941125717499f9c5ad42">More...</a><br/></td></tr>
  88. <tr class="separator:a480283933106941125717499f9c5ad42"><td class="memSeparator" colspan="2">&#160;</td></tr>
  89. <tr class="memitem:a721eeae7ba16f8b92535f4534b583874"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a721eeae7ba16f8b92535f4534b583874"></a>
  90. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00081.html#a721eeae7ba16f8b92535f4534b583874">unlock</a> ()</td></tr>
  91. <tr class="memdesc:a721eeae7ba16f8b92535f4534b583874"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release lock. <br/></td></tr>
  92. <tr class="separator:a721eeae7ba16f8b92535f4534b583874"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:af69874d93822c905bdea0ab9e5ca5b89"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af69874d93822c905bdea0ab9e5ca5b89"></a>
  94. <a class="el" href="a00081.html#abbe0cd12246121753ace00a5a12a90b0">native_handle_type</a>&#160;</td><td class="memItemRight" valign="bottom"><b>native_handle</b> ()</td></tr>
  95. <tr class="separator:af69874d93822c905bdea0ab9e5ca5b89"><td class="memSeparator" colspan="2">&#160;</td></tr>
  96. <tr class="memitem:a0857c4596d7d5de09fe402ccd41d3e42"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0857c4596d7d5de09fe402ccd41d3e42"></a>
  97. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00081.html#a0857c4596d7d5de09fe402ccd41d3e42">set_state</a> (state_t to)</td></tr>
  98. <tr class="memdesc:a0857c4596d7d5de09fe402ccd41d3e42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the internal state. <br/></td></tr>
  99. <tr class="separator:a0857c4596d7d5de09fe402ccd41d3e42"><td class="memSeparator" colspan="2">&#160;</td></tr>
  100. </table><table class="memberdecls">
  101. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
  102. Static Public Attributes</h2></td></tr>
  103. <tr class="memitem:a2677d672446faa842de9de38b3aff80a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2677d672446faa842de9de38b3aff80a"></a>
  104. static const bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_rw_mutex</b> = false</td></tr>
  105. <tr class="separator:a2677d672446faa842de9de38b3aff80a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  106. <tr class="memitem:adf7e9e11c47cc869d219298232d6c0a1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf7e9e11c47cc869d219298232d6c0a1"></a>
  107. static const bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_recursive_mutex</b> = false</td></tr>
  108. <tr class="separator:adf7e9e11c47cc869d219298232d6c0a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:ab729ebd784af412184653c4fa90468d0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab729ebd784af412184653c4fa90468d0"></a>
  110. static const bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_fair_mutex</b> = false</td></tr>
  111. <tr class="separator:ab729ebd784af412184653c4fa90468d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  112. </table><table class="memberdecls">
  113. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  114. Friends</h2></td></tr>
  115. <tr class="memitem:afcf922650b2fd9d76b7b939d8511bbd8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afcf922650b2fd9d76b7b939d8511bbd8"></a>
  116. class&#160;</td><td class="memItemRight" valign="bottom"><b>scoped_lock</b></td></tr>
  117. <tr class="separator:afcf922650b2fd9d76b7b939d8511bbd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  118. </table>
  119. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  120. <div class="textblock"><p>Wrapper around the platform's native reader-writer lock. </p>
  121. <p>For testing purposes only. </p>
  122. </div><h2 class="groupheader">Member Function Documentation</h2>
  123. <a class="anchor" id="a480283933106941125717499f9c5ad42"></a>
  124. <div class="memitem">
  125. <div class="memproto">
  126. <table class="mlabels">
  127. <tr>
  128. <td class="mlabels-left">
  129. <table class="memname">
  130. <tr>
  131. <td class="memname">bool tbb::mutex::try_lock </td>
  132. <td>(</td>
  133. <td class="paramname">)</td><td></td>
  134. <td></td>
  135. </tr>
  136. </table>
  137. </td>
  138. <td class="mlabels-right">
  139. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  140. </tr>
  141. </table>
  142. </div><div class="memdoc">
  143. <p>Try acquiring lock (non-blocking) </p>
  144. <p>Return true if lock acquired; false otherwise. </p>
  145. <p>References <a class="el" href="a00014.html#a3525dbbac0d4eaedfe18bc57b7760857">tbb::aligned_space&lt; T, N &gt;::begin()</a>.</p>
  146. <p>Referenced by <a class="el" href="a00116.html#a46f983371aa852d2427ce69f9a571f78">tbb::mutex::scoped_lock::try_acquire()</a>.</p>
  147. </div>
  148. </div>
  149. <hr/>The documentation for this class was generated from the following file:<ul>
  150. <li>mutex.h</li>
  151. </ul>
  152. </div><!-- contents -->
  153. <hr>
  154. <p></p>
  155. Copyright &copy; 2005-2014 Intel Corporation. All Rights Reserved.
  156. <p></p>
  157. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  158. registered trademarks or trademarks of Intel Corporation or its
  159. subsidiaries in the United States and other countries.
  160. <p></p>
  161. * Other names and brands may be claimed as the property of others.