237 lines
15 KiB
HTML
237 lines
15 KiB
HTML
|
<!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.4"/>
|
||
|
<title>tbb::spin_rw_mutex_v3 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="doxygen.css" rel="stylesheet" type="text/css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||
|
<!-- end header part -->
|
||
|
<!-- Generated by Doxygen 1.8.4 -->
|
||
|
<div id="navrow1" class="tabs">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
||
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="navrow2" class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
||
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
||
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="nav-path" class="navpath">
|
||
|
<ul>
|
||
|
<li class="navelem"><a class="el" href="a00228.html">tbb</a></li><li class="navelem"><a class="el" href="a00136.html">spin_rw_mutex_v3</a></li> </ul>
|
||
|
</div>
|
||
|
</div><!-- top -->
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#nested-classes">Classes</a> |
|
||
|
<a href="#pub-methods">Public Member Functions</a> |
|
||
|
<a href="#pub-static-attribs">Static Public Attributes</a> |
|
||
|
<a href="#pro-types">Protected Types</a> |
|
||
|
<a href="#pro-attribs">Protected Attributes</a> |
|
||
|
<a href="#pro-static-attribs">Static Protected Attributes</a> |
|
||
|
<a href="a00293.html">List of all members</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<div class="title">tbb::spin_rw_mutex_v3 Class Reference<div class="ingroups"><a class="el" href="a00249.html">Synchronization</a></div></div> </div>
|
||
|
</div><!--header-->
|
||
|
<div class="contents">
|
||
|
|
||
|
<p>Fast, unfair, spinning reader-writer lock with backoff and writer-preference.
|
||
|
<a href="a00136.html#details">More...</a></p>
|
||
|
|
||
|
<p><code>#include <spin_rw_mutex.h></code></p>
|
||
|
<div class="dynheader">
|
||
|
Inheritance diagram for tbb::spin_rw_mutex_v3:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center">
|
||
|
<img src="a00136.png" usemap="#tbb::spin_rw_mutex_v3_map" alt=""/>
|
||
|
<map id="tbb::spin_rw_mutex_v3_map" name="tbb::spin_rw_mutex_v3_map">
|
||
|
</map>
|
||
|
</div></div>
|
||
|
<table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
|
||
|
Classes</h2></td></tr>
|
||
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="a00125.html">scoped_lock</a></td></tr>
|
||
|
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">The scoped locking pattern. <a href="a00125.html#details">More...</a><br/></td></tr>
|
||
|
<tr class="separator:"><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:ad30fc1ffa0a2b8134e177e02c5821d7f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad30fc1ffa0a2b8134e177e02c5821d7f"></a>
|
||
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#ad30fc1ffa0a2b8134e177e02c5821d7f">spin_rw_mutex_v3</a> ()</td></tr>
|
||
|
<tr class="memdesc:ad30fc1ffa0a2b8134e177e02c5821d7f"><td class="mdescLeft"> </td><td class="mdescRight">Construct unacquired mutex. <br/></td></tr>
|
||
|
<tr class="separator:ad30fc1ffa0a2b8134e177e02c5821d7f"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:acc7cf2e4b14d3a2a591a3552d74ba99d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc7cf2e4b14d3a2a591a3552d74ba99d"></a>
|
||
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#acc7cf2e4b14d3a2a591a3552d74ba99d">~spin_rw_mutex_v3</a> ()</td></tr>
|
||
|
<tr class="memdesc:acc7cf2e4b14d3a2a591a3552d74ba99d"><td class="mdescLeft"> </td><td class="mdescRight">Destructor asserts if the mutex is acquired, i.e. state is zero. <br/></td></tr>
|
||
|
<tr class="separator:acc7cf2e4b14d3a2a591a3552d74ba99d"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a51e207646300a4c242bb4aaa4e04e9b8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a51e207646300a4c242bb4aaa4e04e9b8"></a>
|
||
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#a51e207646300a4c242bb4aaa4e04e9b8">lock</a> ()</td></tr>
|
||
|
<tr class="memdesc:a51e207646300a4c242bb4aaa4e04e9b8"><td class="mdescLeft"> </td><td class="mdescRight">Acquire writer lock. <br/></td></tr>
|
||
|
<tr class="separator:a51e207646300a4c242bb4aaa4e04e9b8"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ab6ec20b1ec43a49c8c2908984e35b5e8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#ab6ec20b1ec43a49c8c2908984e35b5e8">try_lock</a> ()</td></tr>
|
||
|
<tr class="memdesc:ab6ec20b1ec43a49c8c2908984e35b5e8"><td class="mdescLeft"> </td><td class="mdescRight">Try acquiring writer lock (non-blocking) <a href="#ab6ec20b1ec43a49c8c2908984e35b5e8">More...</a><br/></td></tr>
|
||
|
<tr class="separator:ab6ec20b1ec43a49c8c2908984e35b5e8"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ab04321ed2cdf12ac5825c54591028fc0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab04321ed2cdf12ac5825c54591028fc0"></a>
|
||
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#ab04321ed2cdf12ac5825c54591028fc0">unlock</a> ()</td></tr>
|
||
|
<tr class="memdesc:ab04321ed2cdf12ac5825c54591028fc0"><td class="mdescLeft"> </td><td class="mdescRight">Release lock. <br/></td></tr>
|
||
|
<tr class="separator:ab04321ed2cdf12ac5825c54591028fc0"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:aa0e3bb644e9021d0f80ee36b03f228e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0e3bb644e9021d0f80ee36b03f228e4"></a>
|
||
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#aa0e3bb644e9021d0f80ee36b03f228e4">lock_read</a> ()</td></tr>
|
||
|
<tr class="memdesc:aa0e3bb644e9021d0f80ee36b03f228e4"><td class="mdescLeft"> </td><td class="mdescRight">Acquire reader lock. <br/></td></tr>
|
||
|
<tr class="separator:aa0e3bb644e9021d0f80ee36b03f228e4"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ac932f65b0b66320688e7957ce9c3e2c1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#ac932f65b0b66320688e7957ce9c3e2c1">try_lock_read</a> ()</td></tr>
|
||
|
<tr class="memdesc:ac932f65b0b66320688e7957ce9c3e2c1"><td class="mdescLeft"> </td><td class="mdescRight">Try acquiring reader lock (non-blocking) <a href="#ac932f65b0b66320688e7957ce9c3e2c1">More...</a><br/></td></tr>
|
||
|
<tr class="separator:ac932f65b0b66320688e7957ce9c3e2c1"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
|
||
|
Static Public Attributes</h2></td></tr>
|
||
|
<tr class="memitem:addc8223faacc1bb2cc8626b609ab2c49"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="addc8223faacc1bb2cc8626b609ab2c49"></a>
|
||
|
static const bool </td><td class="memItemRight" valign="bottom"><b>is_rw_mutex</b> = true</td></tr>
|
||
|
<tr class="separator:addc8223faacc1bb2cc8626b609ab2c49"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a7f6aa8fe3e9c7c4ee4cdec6d221ffe45"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f6aa8fe3e9c7c4ee4cdec6d221ffe45"></a>
|
||
|
static const bool </td><td class="memItemRight" valign="bottom"><b>is_recursive_mutex</b> = false</td></tr>
|
||
|
<tr class="separator:a7f6aa8fe3e9c7c4ee4cdec6d221ffe45"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:affd403f6e3822589e985a2c23505fbd1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="affd403f6e3822589e985a2c23505fbd1"></a>
|
||
|
static const bool </td><td class="memItemRight" valign="bottom"><b>is_fair_mutex</b> = false</td></tr>
|
||
|
<tr class="separator:affd403f6e3822589e985a2c23505fbd1"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
|
||
|
Protected Types</h2></td></tr>
|
||
|
<tr class="memitem:a27adc7d791dfaa4a60638313b9d1c1f4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a27adc7d791dfaa4a60638313b9d1c1f4"></a>
|
||
|
typedef intptr_t </td><td class="memItemRight" valign="bottom"><b>state_t</b></td></tr>
|
||
|
<tr class="separator:a27adc7d791dfaa4a60638313b9d1c1f4"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
|
||
|
Protected Attributes</h2></td></tr>
|
||
|
<tr class="memitem:aa28625051072472ccd8a2b19405d6fb3"><td class="memItemLeft" align="right" valign="top">state_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00136.html#aa28625051072472ccd8a2b19405d6fb3">state</a></td></tr>
|
||
|
<tr class="memdesc:aa28625051072472ccd8a2b19405d6fb3"><td class="mdescLeft"> </td><td class="mdescRight">State of lock. <a href="#aa28625051072472ccd8a2b19405d6fb3">More...</a><br/></td></tr>
|
||
|
<tr class="separator:aa28625051072472ccd8a2b19405d6fb3"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-attribs"></a>
|
||
|
Static Protected Attributes</h2></td></tr>
|
||
|
<tr class="memitem:aaeec59dde09fe92be196ecddb480777b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaeec59dde09fe92be196ecddb480777b"></a>
|
||
|
static const state_t </td><td class="memItemRight" valign="bottom"><b>WRITER</b> = 1</td></tr>
|
||
|
<tr class="separator:aaeec59dde09fe92be196ecddb480777b"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a5b321914828e5e21baf24d58f32c66d5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5b321914828e5e21baf24d58f32c66d5"></a>
|
||
|
static const state_t </td><td class="memItemRight" valign="bottom"><b>WRITER_PENDING</b> = 2</td></tr>
|
||
|
<tr class="separator:a5b321914828e5e21baf24d58f32c66d5"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a6cc93cdcf4ad43f6bf8b0f76cde66f9e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6cc93cdcf4ad43f6bf8b0f76cde66f9e"></a>
|
||
|
static const state_t </td><td class="memItemRight" valign="bottom"><b>READERS</b> = ~(WRITER | WRITER_PENDING)</td></tr>
|
||
|
<tr class="separator:a6cc93cdcf4ad43f6bf8b0f76cde66f9e"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:af1386a2fa5979432e4a58b94e68db23f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af1386a2fa5979432e4a58b94e68db23f"></a>
|
||
|
static const state_t </td><td class="memItemRight" valign="bottom"><b>ONE_READER</b> = 4</td></tr>
|
||
|
<tr class="separator:af1386a2fa5979432e4a58b94e68db23f"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a6a811c72bd7e5ad6a3a9161ee05e298c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a811c72bd7e5ad6a3a9161ee05e298c"></a>
|
||
|
static const state_t </td><td class="memItemRight" valign="bottom"><b>BUSY</b> = WRITER | READERS</td></tr>
|
||
|
<tr class="separator:a6a811c72bd7e5ad6a3a9161ee05e298c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table>
|
||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||
|
<div class="textblock"><p>Fast, unfair, spinning reader-writer lock with backoff and writer-preference. </p>
|
||
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
||
|
<a class="anchor" id="ab6ec20b1ec43a49c8c2908984e35b5e8"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool tbb::spin_rw_mutex_v3::try_lock </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname">)</td><td></td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Try acquiring writer lock (non-blocking) </p>
|
||
|
<p>Return true if lock acquired; false otherwise. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ac932f65b0b66320688e7957ce9c3e2c1"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool tbb::spin_rw_mutex_v3::try_lock_read </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname">)</td><td></td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Try acquiring reader lock (non-blocking) </p>
|
||
|
<p>Return true if reader lock acquired; false otherwise. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<h2 class="groupheader">Member Data Documentation</h2>
|
||
|
<a class="anchor" id="aa28625051072472ccd8a2b19405d6fb3"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">state_t tbb::spin_rw_mutex_v3::state</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>State of lock. </p>
|
||
|
<p>Bit 0 = writer is holding lock Bit 1 = request by a writer to acquire lock (hint to readers to wait) Bit 2..N = number of readers holding lock </p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="a00125.html#a99e279a995a51abfb87b865e886949f8">tbb::spin_rw_mutex_v3::scoped_lock::release()</a>, and <a class="el" href="a00136.html#ab04321ed2cdf12ac5825c54591028fc0">unlock()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
||
|
<li>spin_rw_mutex.h</li>
|
||
|
</ul>
|
||
|
</div><!-- contents -->
|
||
|
<hr>
|
||
|
<p></p>
|
||
|
Copyright © 2005-2016 Intel Corporation. All Rights Reserved.
|
||
|
<p></p>
|
||
|
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
|
||
|
registered trademarks or trademarks of Intel Corporation or its
|
||
|
subsidiaries in the United States and other countries.
|
||
|
<p></p>
|
||
|
* Other names and brands may be claimed as the property of others.
|