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.

174 lines
10 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::spin_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="a00127.html">spin_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-methods">Public Member Functions</a> &#124;
  43. <a href="#pub-static-attribs">Static Public Attributes</a> &#124;
  44. <a href="#friends">Friends</a> &#124;
  45. <a href="a00281.html">List of all members</a> </div>
  46. <div class="headertitle">
  47. <div class="title">tbb::spin_mutex Class Reference<div class="ingroups"><a class="el" href="a00237.html">Synchronization</a></div></div> </div>
  48. </div><!--header-->
  49. <div class="contents">
  50. <p>A lock that occupies a single byte.
  51. <a href="a00127.html#details">More...</a></p>
  52. <p><code>#include &lt;spin_mutex.h&gt;</code></p>
  53. <table class="memberdecls">
  54. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
  55. Classes</h2></td></tr>
  56. <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00113.html">scoped_lock</a></td></tr>
  57. <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents acquisition of a mutex. <a href="a00113.html#details">More...</a><br/></td></tr>
  58. <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
  59. </table><table class="memberdecls">
  60. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  61. Public Member Functions</h2></td></tr>
  62. <tr class="memitem:a6c96196965bf7df426311d282ad3c378"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00127.html#a6c96196965bf7df426311d282ad3c378">spin_mutex</a> ()</td></tr>
  63. <tr class="memdesc:a6c96196965bf7df426311d282ad3c378"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct unacquired lock. <a href="#a6c96196965bf7df426311d282ad3c378">More...</a><br/></td></tr>
  64. <tr class="separator:a6c96196965bf7df426311d282ad3c378"><td class="memSeparator" colspan="2">&#160;</td></tr>
  65. <tr class="memitem:a4ec484f4df6ec5595ec821ef20bd6cd7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4ec484f4df6ec5595ec821ef20bd6cd7"></a>
  66. void __TBB_EXPORTED_METHOD&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00127.html#a4ec484f4df6ec5595ec821ef20bd6cd7">internal_construct</a> ()</td></tr>
  67. <tr class="memdesc:a4ec484f4df6ec5595ec821ef20bd6cd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal constructor with ITT instrumentation. <br/></td></tr>
  68. <tr class="separator:a4ec484f4df6ec5595ec821ef20bd6cd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  69. <tr class="memitem:a8957e40b0781192419d01d28e5205ec4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8957e40b0781192419d01d28e5205ec4"></a>
  70. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00127.html#a8957e40b0781192419d01d28e5205ec4">lock</a> ()</td></tr>
  71. <tr class="memdesc:a8957e40b0781192419d01d28e5205ec4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire lock. <br/></td></tr>
  72. <tr class="separator:a8957e40b0781192419d01d28e5205ec4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  73. <tr class="memitem:a003ffb196d22bf22ca22142338b7eeab"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00127.html#a003ffb196d22bf22ca22142338b7eeab">try_lock</a> ()</td></tr>
  74. <tr class="memdesc:a003ffb196d22bf22ca22142338b7eeab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try acquiring lock (non-blocking) <a href="#a003ffb196d22bf22ca22142338b7eeab">More...</a><br/></td></tr>
  75. <tr class="separator:a003ffb196d22bf22ca22142338b7eeab"><td class="memSeparator" colspan="2">&#160;</td></tr>
  76. <tr class="memitem:adfcf8fe840aa73c08c2cadd570fd48fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adfcf8fe840aa73c08c2cadd570fd48fd"></a>
  77. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00127.html#adfcf8fe840aa73c08c2cadd570fd48fd">unlock</a> ()</td></tr>
  78. <tr class="memdesc:adfcf8fe840aa73c08c2cadd570fd48fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release lock. <br/></td></tr>
  79. <tr class="separator:adfcf8fe840aa73c08c2cadd570fd48fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  80. </table><table class="memberdecls">
  81. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
  82. Static Public Attributes</h2></td></tr>
  83. <tr class="memitem:a7c3354db4bd5cc81bccee9f249abb9e8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c3354db4bd5cc81bccee9f249abb9e8"></a>
  84. static const bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_rw_mutex</b> = false</td></tr>
  85. <tr class="separator:a7c3354db4bd5cc81bccee9f249abb9e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  86. <tr class="memitem:a0cae048c5dc5deffe75464e4a3a2b752"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0cae048c5dc5deffe75464e4a3a2b752"></a>
  87. static const bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_recursive_mutex</b> = false</td></tr>
  88. <tr class="separator:a0cae048c5dc5deffe75464e4a3a2b752"><td class="memSeparator" colspan="2">&#160;</td></tr>
  89. <tr class="memitem:ad00ec9a97f34c9160300950b36deac3e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad00ec9a97f34c9160300950b36deac3e"></a>
  90. static const bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_fair_mutex</b> = false</td></tr>
  91. <tr class="separator:ad00ec9a97f34c9160300950b36deac3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  92. </table><table class="memberdecls">
  93. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  94. Friends</h2></td></tr>
  95. <tr class="memitem:afcf922650b2fd9d76b7b939d8511bbd8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afcf922650b2fd9d76b7b939d8511bbd8"></a>
  96. class&#160;</td><td class="memItemRight" valign="bottom"><b>scoped_lock</b></td></tr>
  97. <tr class="separator:afcf922650b2fd9d76b7b939d8511bbd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  98. </table>
  99. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  100. <div class="textblock"><p>A lock that occupies a single byte. </p>
  101. <p>A <a class="el" href="a00127.html" title="A lock that occupies a single byte. ">spin_mutex</a> is a spin mutex that fits in a single byte. It should be used only for locking short critical sections (typically less than 20 instructions) when fairness is not an issue. If zero-initialized, the mutex is considered unheld. </p>
  102. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  103. <a class="anchor" id="a6c96196965bf7df426311d282ad3c378"></a>
  104. <div class="memitem">
  105. <div class="memproto">
  106. <table class="mlabels">
  107. <tr>
  108. <td class="mlabels-left">
  109. <table class="memname">
  110. <tr>
  111. <td class="memname">tbb::spin_mutex::spin_mutex </td>
  112. <td>(</td>
  113. <td class="paramname">)</td><td></td>
  114. <td></td>
  115. </tr>
  116. </table>
  117. </td>
  118. <td class="mlabels-right">
  119. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  120. </tr>
  121. </table>
  122. </div><div class="memdoc">
  123. <p>Construct unacquired lock. </p>
  124. <p>Equivalent to zero-initialization of *this. </p>
  125. <p>References <a class="el" href="a00127.html#a4ec484f4df6ec5595ec821ef20bd6cd7">internal_construct()</a>.</p>
  126. </div>
  127. </div>
  128. <h2 class="groupheader">Member Function Documentation</h2>
  129. <a class="anchor" id="a003ffb196d22bf22ca22142338b7eeab"></a>
  130. <div class="memitem">
  131. <div class="memproto">
  132. <table class="mlabels">
  133. <tr>
  134. <td class="mlabels-left">
  135. <table class="memname">
  136. <tr>
  137. <td class="memname">bool tbb::spin_mutex::try_lock </td>
  138. <td>(</td>
  139. <td class="paramname">)</td><td></td>
  140. <td></td>
  141. </tr>
  142. </table>
  143. </td>
  144. <td class="mlabels-right">
  145. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  146. </tr>
  147. </table>
  148. </div><div class="memdoc">
  149. <p>Try acquiring lock (non-blocking) </p>
  150. <p>Return true if lock acquired; false otherwise. </p>
  151. <p>References <a class="el" href="a00014.html#a3525dbbac0d4eaedfe18bc57b7760857">tbb::aligned_space&lt; T, N &gt;::begin()</a>.</p>
  152. </div>
  153. </div>
  154. <hr/>The documentation for this class was generated from the following file:<ul>
  155. <li>spin_mutex.h</li>
  156. </ul>
  157. </div><!-- contents -->
  158. <hr>
  159. <p></p>
  160. Copyright &copy; 2005-2014 Intel Corporation. All Rights Reserved.
  161. <p></p>
  162. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  163. registered trademarks or trademarks of Intel Corporation or its
  164. subsidiaries in the United States and other countries.
  165. <p></p>
  166. * Other names and brands may be claimed as the property of others.