/usr/share/doc/libjuce/apiref/classCriticalSection.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: CriticalSection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="classCriticalSection-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">CriticalSection Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A re-entrant mutex.
<a href="classCriticalSection.html#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for CriticalSection:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center">
<img src="classCriticalSection.png" usemap="#CriticalSection_map" alt=""/>
<map id="CriticalSection_map" name="CriticalSection_map">
<area href="classArrayAllocationBase.html" alt="ArrayAllocationBase< Steinberg::Vst::Event, CriticalSection >" shape="rect" coords="0,56,404,80"/>
<area href="classArrayAllocationBase.html" alt="ArrayAllocationBase< UnitTestRunner::TestResult *, CriticalSection >" shape="rect" coords="414,56,818,80"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a586568fcce3a9c6a0f1547518fd6ddb6"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classGenericScopedLock.html">GenericScopedLock</a>< <a class="el" href="classCriticalSection.html">CriticalSection</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#a586568fcce3a9c6a0f1547518fd6ddb6">ScopedLockType</a></td></tr>
<tr class="memdesc:a586568fcce3a9c6a0f1547518fd6ddb6"><td class="mdescLeft"> </td><td class="mdescRight">Provides the type of scoped lock to use with a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a>. <a href="#a586568fcce3a9c6a0f1547518fd6ddb6">More...</a><br /></td></tr>
<tr class="separator:a586568fcce3a9c6a0f1547518fd6ddb6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a69d6b613f2638fbae341cfd06df478c7"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classGenericScopedUnlock.html">GenericScopedUnlock</a>< <a class="el" href="classCriticalSection.html">CriticalSection</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#a69d6b613f2638fbae341cfd06df478c7">ScopedUnlockType</a></td></tr>
<tr class="memdesc:a69d6b613f2638fbae341cfd06df478c7"><td class="mdescLeft"> </td><td class="mdescRight">Provides the type of scoped unlocker to use with a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a>. <a href="#a69d6b613f2638fbae341cfd06df478c7">More...</a><br /></td></tr>
<tr class="separator:a69d6b613f2638fbae341cfd06df478c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a745e5e36d8c6a33ea1fcbbfa2fff00a3"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classGenericScopedTryLock.html">GenericScopedTryLock</a>< <a class="el" href="classCriticalSection.html">CriticalSection</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#a745e5e36d8c6a33ea1fcbbfa2fff00a3">ScopedTryLockType</a></td></tr>
<tr class="memdesc:a745e5e36d8c6a33ea1fcbbfa2fff00a3"><td class="mdescLeft"> </td><td class="mdescRight">Provides the type of scoped try-locker to use with a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a>. <a href="#a745e5e36d8c6a33ea1fcbbfa2fff00a3">More...</a><br /></td></tr>
<tr class="separator:a745e5e36d8c6a33ea1fcbbfa2fff00a3"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aaa4d9ea166cd7ce8ef369a7934e26b97"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#aaa4d9ea166cd7ce8ef369a7934e26b97">CriticalSection</a> () noexcept</td></tr>
<tr class="memdesc:aaa4d9ea166cd7ce8ef369a7934e26b97"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a> object. <a href="#aaa4d9ea166cd7ce8ef369a7934e26b97">More...</a><br /></td></tr>
<tr class="separator:aaa4d9ea166cd7ce8ef369a7934e26b97"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae1ed672427d129fb5102459354d33422"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#ae1ed672427d129fb5102459354d33422">~CriticalSection</a> () noexcept</td></tr>
<tr class="memdesc:ae1ed672427d129fb5102459354d33422"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#ae1ed672427d129fb5102459354d33422">More...</a><br /></td></tr>
<tr class="separator:ae1ed672427d129fb5102459354d33422"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a20c4b0714061cc488d220b1b5a77aa1c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#a20c4b0714061cc488d220b1b5a77aa1c">enter</a> () const noexcept</td></tr>
<tr class="memdesc:a20c4b0714061cc488d220b1b5a77aa1c"><td class="mdescLeft"> </td><td class="mdescRight">Acquires the lock. <a href="#a20c4b0714061cc488d220b1b5a77aa1c">More...</a><br /></td></tr>
<tr class="separator:a20c4b0714061cc488d220b1b5a77aa1c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2c12101da7ebf8455de49652f377d313"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#a2c12101da7ebf8455de49652f377d313">tryEnter</a> () const noexcept</td></tr>
<tr class="memdesc:a2c12101da7ebf8455de49652f377d313"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to lock this critical section without blocking. <a href="#a2c12101da7ebf8455de49652f377d313">More...</a><br /></td></tr>
<tr class="separator:a2c12101da7ebf8455de49652f377d313"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a856bbcc18f0367ae231f7277d9cb33f8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCriticalSection.html#a856bbcc18f0367ae231f7277d9cb33f8">exit</a> () const noexcept</td></tr>
<tr class="memdesc:a856bbcc18f0367ae231f7277d9cb33f8"><td class="mdescLeft"> </td><td class="mdescRight">Releases the lock. <a href="#a856bbcc18f0367ae231f7277d9cb33f8">More...</a><br /></td></tr>
<tr class="separator:a856bbcc18f0367ae231f7277d9cb33f8"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A re-entrant mutex. </p>
<p>A <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a> acts as a re-entrant mutex object. The best way to lock and unlock one of these is by using RAII in the form of a local ScopedLock object - have a look through the codebase for many examples of how to do this.</p>
<p>In almost all cases you'll want to declare your <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a> as a member variable. Occasionally you may want to declare one as a static variable, but in that case the usual C++ static object order-of-construction warnings should be heeded.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="juce__CriticalSection_8h.html#acedaa6fb1373c96d2d15e7a617a5cec8" title="Automatically locks and unlocks a CriticalSection object. ">ScopedLock</a>, <a class="el" href="juce__CriticalSection_8h.html#a5d3ed387d4c09d8fbfb8ad1f2db610df" title="Automatically tries to lock and unlock a CriticalSection object. ">ScopedTryLock</a>, <a class="el" href="juce__CriticalSection_8h.html#a4cc435f24ace2a8f59b488ed66d9cf2c" title="Automatically unlocks and re-locks a CriticalSection object. ">ScopedUnlock</a>, <a class="el" href="classSpinLock.html" title="A simple spin-lock class that can be used as a simple, low-overhead mutex for uncontended situations...">SpinLock</a>, <a class="el" href="classReadWriteLock.html" title="A critical section that allows multiple simultaneous readers. ">ReadWriteLock</a>, <a class="el" href="classThread.html" title="Encapsulates a thread. ">Thread</a>, <a class="el" href="classInterProcessLock.html" title="Acts as a critical section which processes can use to block each other. ">InterProcessLock</a> </dd></dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a586568fcce3a9c6a0f1547518fd6ddb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a586568fcce3a9c6a0f1547518fd6ddb6">§ </a></span>ScopedLockType</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="classGenericScopedLock.html">GenericScopedLock</a><<a class="el" href="classCriticalSection.html">CriticalSection</a>> <a class="el" href="classCriticalSection.html#a586568fcce3a9c6a0f1547518fd6ddb6">CriticalSection::ScopedLockType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Provides the type of scoped lock to use with a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a>. </p>
</div>
</div>
<a id="a69d6b613f2638fbae341cfd06df478c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69d6b613f2638fbae341cfd06df478c7">§ </a></span>ScopedUnlockType</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="classGenericScopedUnlock.html">GenericScopedUnlock</a><<a class="el" href="classCriticalSection.html">CriticalSection</a>> <a class="el" href="classCriticalSection.html#a69d6b613f2638fbae341cfd06df478c7">CriticalSection::ScopedUnlockType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Provides the type of scoped unlocker to use with a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a>. </p>
</div>
</div>
<a id="a745e5e36d8c6a33ea1fcbbfa2fff00a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a745e5e36d8c6a33ea1fcbbfa2fff00a3">§ </a></span>ScopedTryLockType</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="classGenericScopedTryLock.html">GenericScopedTryLock</a><<a class="el" href="classCriticalSection.html">CriticalSection</a>> <a class="el" href="classCriticalSection.html#a745e5e36d8c6a33ea1fcbbfa2fff00a3">CriticalSection::ScopedTryLockType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Provides the type of scoped try-locker to use with a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a>. </p>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="aaa4d9ea166cd7ce8ef369a7934e26b97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa4d9ea166cd7ce8ef369a7934e26b97">§ </a></span>CriticalSection()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">CriticalSection::CriticalSection </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classCriticalSection.html" title="A re-entrant mutex. ">CriticalSection</a> object. </p>
</div>
</div>
<a id="ae1ed672427d129fb5102459354d33422"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1ed672427d129fb5102459354d33422">§ </a></span>~CriticalSection()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">CriticalSection::~CriticalSection </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
<p>If the critical section is deleted whilst locked, any subsequent behaviour is unpredictable. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a20c4b0714061cc488d220b1b5a77aa1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20c4b0714061cc488d220b1b5a77aa1c">§ </a></span>enter()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void CriticalSection::enter </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Acquires the lock. </p>
<p>If the lock is already held by the caller thread, the method returns immediately. If the lock is currently held by another thread, this will wait until it becomes free.</p>
<p>It's strongly recommended that you never call this method directly - instead use the ScopedLock class to manage the locking using an RAII pattern instead.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classCriticalSection.html#a856bbcc18f0367ae231f7277d9cb33f8" title="Releases the lock. ">exit</a>, <a class="el" href="classCriticalSection.html#a2c12101da7ebf8455de49652f377d313" title="Attempts to lock this critical section without blocking. ">tryEnter</a>, <a class="el" href="juce__CriticalSection_8h.html#acedaa6fb1373c96d2d15e7a617a5cec8" title="Automatically locks and unlocks a CriticalSection object. ">ScopedLock</a> </dd></dl>
</div>
</div>
<a id="a2c12101da7ebf8455de49652f377d313"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c12101da7ebf8455de49652f377d313">§ </a></span>tryEnter()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool CriticalSection::tryEnter </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Attempts to lock this critical section without blocking. </p>
<p>This method behaves identically to <a class="el" href="classCriticalSection.html#a20c4b0714061cc488d220b1b5a77aa1c" title="Acquires the lock. ">CriticalSection::enter</a>, except that the caller thread does not wait if the lock is currently held by another thread but returns false immediately.</p>
<dl class="section return"><dt>Returns</dt><dd>false if the lock is currently held by another thread, true otherwise. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classCriticalSection.html#a20c4b0714061cc488d220b1b5a77aa1c" title="Acquires the lock. ">enter</a> </dd></dl>
</div>
</div>
<a id="a856bbcc18f0367ae231f7277d9cb33f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a856bbcc18f0367ae231f7277d9cb33f8">§ </a></span>exit()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void CriticalSection::exit </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Releases the lock. </p>
<p>If the caller thread hasn't got the lock, this can have unpredictable results.</p>
<p>If the <a class="el" href="classCriticalSection.html#a20c4b0714061cc488d220b1b5a77aa1c" title="Acquires the lock. ">enter()</a> method has been called multiple times by the thread, each call must be matched by a call to <a class="el" href="classCriticalSection.html#a856bbcc18f0367ae231f7277d9cb33f8" title="Releases the lock. ">exit()</a> before other threads will be allowed to take over the lock.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classCriticalSection.html#a20c4b0714061cc488d220b1b5a77aa1c" title="Acquires the lock. ">enter</a>, <a class="el" href="juce__CriticalSection_8h.html#acedaa6fb1373c96d2d15e7a617a5cec8" title="Automatically locks and unlocks a CriticalSection object. ">ScopedLock</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__CriticalSection_8h.html">juce_CriticalSection.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|