⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classpreadwritemutex.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PReadWriteMutex class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>PReadWriteMutex Class Reference</h1><code>#include &lt;<a class="el" href="syncthrd_8h-source.html">syncthrd.h</a>&gt;</code><p><p>Inheritance diagram for PReadWriteMutex:<p><center><img src="classPReadWriteMutex.png" usemap="#PReadWriteMutex_map" border="0" alt=""></center><map name="PReadWriteMutex_map"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,112,24"></map><a href="classPReadWriteMutex-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td colspan="2"><div class="groupHeader">Construction</div></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#z419_0">PReadWriteMutex</a> ()</td></tr><tr><td colspan="2"><div class="groupHeader">Operations</div></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#z421_0">StartRead</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#z421_1">EndRead</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#z421_2">StartWrite</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#z421_3">EndWrite</a> ()</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPReadWriteMutex_1_1Nest.html">Nest</a> *&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#b0">GetNest</a> () const</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPReadWriteMutex_1_1Nest.html">Nest</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#b1">StartNest</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#b2">EndNest</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#b3">InternalStartRead</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#b4">InternalEndRead</a> ()</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPSemaphore.html">PSemaphore</a>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n0">readerSemaphore</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMutex.html">PMutex</a>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n1">readerMutex</a></td></tr><tr><td nowrap align=right valign=top>unsigned&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n2">readerCount</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMutex.html">PMutex</a>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n3">starvationPreventer</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPSemaphore.html">PSemaphore</a>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n4">writerSemaphore</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMutex.html">PMutex</a>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n5">writerMutex</a></td></tr><tr><td nowrap align=right valign=top>unsigned&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n6">writerCount</a></td></tr><tr><td nowrap align=right valign=top>PDictionary&lt; <a class="el" href="classPOrdinalKey.html">POrdinalKey</a>,<br> <a class="el" href="classPReadWriteMutex_1_1Nest.html">Nest</a> &gt;&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n7">nestedThreads</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMutex.html">PMutex</a>&nbsp;</td><td valign=bottom><a class="el" href="classPReadWriteMutex.html#n8">nestingMutex</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class defines a thread synchonisation object.<p>This is a special type of mutual exclusion, where the excluded area may have multiple read threads but only one write thread and the read threads are blocked on write as well. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="z419_0" doxytag="PReadWriteMutex::PReadWriteMutex"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PReadWriteMutex::PReadWriteMutex </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="b2" doxytag="PReadWriteMutex::EndNest"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PReadWriteMutex::EndNest </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="z421_1" doxytag="PReadWriteMutex::EndRead"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PReadWriteMutex::EndRead </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This function attempts to release the mutex for reading.     </td>  </tr></table><a name="z421_3" doxytag="PReadWriteMutex::EndWrite"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PReadWriteMutex::EndWrite </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This function attempts to release the mutex for writing. Note, if the same thread had a read lock when the <a class="el" href="classPReadWriteMutex.html#z421_2">StartWrite()</a> was called which has not yet been released by an <a class="el" href="classPReadWriteMutex.html#z421_1">EndRead()</a> call then this will reacquire the read lock.<p>It should also be noted that a consequence of this is that another thread may acquire the write lock before the thread that regains the read lock. Thus it is impossibly to go straight from a write lock to read lock without the possiblility of the object being changed and application logic should take this into account.     </td>  </tr></table><a name="b0" doxytag="PReadWriteMutex::GetNest"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="classPReadWriteMutex_1_1Nest.html">Nest</a>* PReadWriteMutex::GetNest </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="b4" doxytag="PReadWriteMutex::InternalEndRead"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PReadWriteMutex::InternalEndRead </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="b3" doxytag="PReadWriteMutex::InternalStartRead"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PReadWriteMutex::InternalStartRead </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="b1" doxytag="PReadWriteMutex::StartNest"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="classPReadWriteMutex_1_1Nest.html">Nest</a>&amp; PReadWriteMutex::StartNest </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -