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.

129 lines
7.9 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::queuing_mutex::scoped_lock 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="a00093.html">queuing_mutex</a></li><li class="navelem"><a class="el" href="a00121.html">scoped_lock</a></li> </ul>
  37. </div>
  38. </div><!-- top -->
  39. <div class="header">
  40. <div class="summary">
  41. <a href="#pub-methods">Public Member Functions</a> &#124;
  42. <a href="a00272.html">List of all members</a> </div>
  43. <div class="headertitle">
  44. <div class="title">tbb::queuing_mutex::scoped_lock Class Reference</div> </div>
  45. </div><!--header-->
  46. <div class="contents">
  47. <p>The scoped locking pattern.
  48. <a href="a00121.html#details">More...</a></p>
  49. <p><code>#include &lt;queuing_mutex.h&gt;</code></p>
  50. <div class="dynheader">
  51. Inheritance diagram for tbb::queuing_mutex::scoped_lock:</div>
  52. <div class="dyncontent">
  53. <div class="center">
  54. <img src="a00121.png" usemap="#tbb::queuing_mutex::scoped_lock_map" alt=""/>
  55. <map id="tbb::queuing_mutex::scoped_lock_map" name="tbb::queuing_mutex::scoped_lock_map">
  56. </map>
  57. </div></div>
  58. <table class="memberdecls">
  59. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  60. Public Member Functions</h2></td></tr>
  61. <tr class="memitem:a0afe0107eb0aae613e726f67624d2fca"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00121.html#a0afe0107eb0aae613e726f67624d2fca">scoped_lock</a> ()</td></tr>
  62. <tr class="memdesc:a0afe0107eb0aae613e726f67624d2fca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct lock that has not acquired a mutex. <a href="#a0afe0107eb0aae613e726f67624d2fca">More...</a><br/></td></tr>
  63. <tr class="separator:a0afe0107eb0aae613e726f67624d2fca"><td class="memSeparator" colspan="2">&#160;</td></tr>
  64. <tr class="memitem:aa82d9da0dcfe5b21f1c08473f8223105"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa82d9da0dcfe5b21f1c08473f8223105"></a>
  65. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00121.html#aa82d9da0dcfe5b21f1c08473f8223105">scoped_lock</a> (<a class="el" href="a00093.html">queuing_mutex</a> &amp;m)</td></tr>
  66. <tr class="memdesc:aa82d9da0dcfe5b21f1c08473f8223105"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire lock on given mutex. <br/></td></tr>
  67. <tr class="separator:aa82d9da0dcfe5b21f1c08473f8223105"><td class="memSeparator" colspan="2">&#160;</td></tr>
  68. <tr class="memitem:a469ec43836a8dd250ce0a22b02945630"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a469ec43836a8dd250ce0a22b02945630"></a>
  69. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00121.html#a469ec43836a8dd250ce0a22b02945630">~scoped_lock</a> ()</td></tr>
  70. <tr class="memdesc:a469ec43836a8dd250ce0a22b02945630"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release lock (if lock is held). <br/></td></tr>
  71. <tr class="separator:a469ec43836a8dd250ce0a22b02945630"><td class="memSeparator" colspan="2">&#160;</td></tr>
  72. <tr class="memitem:abf8aa7ccd48d54dcb53665700a17d02a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf8aa7ccd48d54dcb53665700a17d02a"></a>
  73. void __TBB_EXPORTED_METHOD&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00121.html#abf8aa7ccd48d54dcb53665700a17d02a">acquire</a> (<a class="el" href="a00093.html">queuing_mutex</a> &amp;m)</td></tr>
  74. <tr class="memdesc:abf8aa7ccd48d54dcb53665700a17d02a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire lock on given mutex. <br/></td></tr>
  75. <tr class="separator:abf8aa7ccd48d54dcb53665700a17d02a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  76. <tr class="memitem:ab4800ba9e743cd91f152036a6689b0e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab4800ba9e743cd91f152036a6689b0e9"></a>
  77. bool __TBB_EXPORTED_METHOD&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00121.html#ab4800ba9e743cd91f152036a6689b0e9">try_acquire</a> (<a class="el" href="a00093.html">queuing_mutex</a> &amp;m)</td></tr>
  78. <tr class="memdesc:ab4800ba9e743cd91f152036a6689b0e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire lock on given mutex if free (i.e. non-blocking) <br/></td></tr>
  79. <tr class="separator:ab4800ba9e743cd91f152036a6689b0e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  80. <tr class="memitem:aaa065e48b428b8d43e9bb931ba9e6f6c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa065e48b428b8d43e9bb931ba9e6f6c"></a>
  81. void __TBB_EXPORTED_METHOD&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00121.html#aaa065e48b428b8d43e9bb931ba9e6f6c">release</a> ()</td></tr>
  82. <tr class="memdesc:aaa065e48b428b8d43e9bb931ba9e6f6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release lock. <br/></td></tr>
  83. <tr class="separator:aaa065e48b428b8d43e9bb931ba9e6f6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  84. </table>
  85. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  86. <div class="textblock"><p>The scoped locking pattern. </p>
  87. <p>It helps to avoid the common problem of forgetting to release lock. It also nicely provides the "node" for queuing locks. </p>
  88. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  89. <a class="anchor" id="a0afe0107eb0aae613e726f67624d2fca"></a>
  90. <div class="memitem">
  91. <div class="memproto">
  92. <table class="mlabels">
  93. <tr>
  94. <td class="mlabels-left">
  95. <table class="memname">
  96. <tr>
  97. <td class="memname">tbb::queuing_mutex::scoped_lock::scoped_lock </td>
  98. <td>(</td>
  99. <td class="paramname">)</td><td></td>
  100. <td></td>
  101. </tr>
  102. </table>
  103. </td>
  104. <td class="mlabels-right">
  105. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  106. </tr>
  107. </table>
  108. </div><div class="memdoc">
  109. <p>Construct lock that has not acquired a mutex. </p>
  110. <p>Equivalent to zero-initialization of *this. </p>
  111. </div>
  112. </div>
  113. <hr/>The documentation for this class was generated from the following file:<ul>
  114. <li>queuing_mutex.h</li>
  115. </ul>
  116. </div><!-- contents -->
  117. <hr>
  118. <p></p>
  119. Copyright &copy; 2005-2014 Intel Corporation. All Rights Reserved.
  120. <p></p>
  121. Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
  122. registered trademarks or trademarks of Intel Corporation or its
  123. subsidiaries in the United States and other countries.
  124. <p></p>
  125. * Other names and brands may be claimed as the property of others.