📄 classpsemaphore.html
字号:
<td class="md" nowrap valign="top">ThreadQueue </td> <td class="mdname" nowrap> , </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPThread.html">PThread</a> </td> <td class="mdname" nowrap> </td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="z347_2" doxytag="PSemaphore::Signal"></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"> virtual void PSemaphore::Signal </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>If there are waiting (blocked) threads then unblock the first one that was blocked. If no waiting threads and the count is less than the maximum then increment the semaphore. <p>Reimplemented in <a class="el" href="classPSyncPointAck.html#a0">PSyncPointAck</a>, and <a class="el" href="classPCondMutex.html#a1">PCondMutex</a>. </td> </tr></table><a name="z347_1" doxytag="PSemaphore::Wait"></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"> virtual BOOL PSemaphore::Wait </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPTimeInterval.html">PTimeInterval</a> & </td> <td class="mdname1" valign="top" nowrap> <em>timeout</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>If the semaphore count is > 0, decrement the semaphore and return. If if is = 0 then wait (block) for the specified amount of time.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if semaphore was signalled, FALSE if timed out. </dl> </td> </tr></table><a name="z347_0" doxytag="PSemaphore::Wait"></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"> virtual void PSemaphore::Wait </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>If the semaphore count is > 0, decrement the semaphore and return. If if is = 0 then wait (block). </td> </tr></table><a name="z347_3" doxytag="PSemaphore::WillBlock"></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"> virtual BOOL PSemaphore::WillBlock </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Determine if the semaphore would block if the <a class="el" href="classPSemaphore.html#z347_0">Wait()</a># function were called.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if semaphore will block when <a class="el" href="classPSemaphore.html#z347_0">Wait()</a> is called. </dl> </td> </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PSemaphore::initialVar"></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"> unsigned PSemaphore::initialVar<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="n1" doxytag="PSemaphore::maxCountVar"></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"> unsigned PSemaphore::maxCountVar<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="n2" doxytag="PSemaphore::waitQueue"></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"> ThreadQueue PSemaphore::waitQueue<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr>The documentation for this class was generated from the following file:<ul><li><a class="el" href="semaphor_8h-source.html">semaphor.h</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:19 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -