📄 classpsyncpointack.html
字号:
<!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>PSyncPointAck 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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>PSyncPointAck Class Reference</h1><code>#include <<a class="el" href="syncthrd_8h-source.html">syncthrd.h</a>></code><p><p>Inheritance diagram for PSyncPointAck:<p><center><img src="classPSyncPointAck.png" usemap="#PSyncPointAck_map" border="0" alt=""></center><map name="PSyncPointAck_map"><area href="classPSyncPoint.html" alt="PSyncPoint" shape="rect" coords="0,112,99,136"><area href="classPSemaphore.html" alt="PSemaphore" shape="rect" coords="0,56,99,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,99,24"></map><a href="classPSyncPointAck-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 nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPSyncPointAck.html#a0">Signal</a> ()</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPSyncPointAck.html#a1">Signal</a> (const <a class="el" href="classPTimeInterval.html">PTimeInterval</a> &waitTime)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPSyncPointAck.html#a2">Acknowledge</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="classPSyncPoint.html">PSyncPoint</a> </td><td valign=bottom><a class="el" href="classPSyncPointAck.html#n0">ack</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class defines a thread synchonisation object.<p>This may be used to send signals to a thread and await an acknowldegement that the signal was processed. This can be be used to initate an action in another thread and wait for the action to be completed. \begin{verbatim} ... thread one while (condition) { sync.Wait(); do_something(); sync.Acknowledge(); }<p>... thread 2 do_something_else(); sync.Signal(); // At this point thread 1 wake up and does something. do_yet_more(); // However, this does not get done until Acknowldege() is called in the other thread.<p>\end{verbatim} <p><hr><h2>Member Function Documentation</h2><a name="a2" doxytag="PSyncPointAck::Acknowledge"></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 PSyncPointAck::Acknowledge </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This indicates that the thread that was blocked in a <a class="el" href="classPSemaphore.html#z347_0">Wait()</a> on this synchonrisation object has completed the operation the signal was intended to initiate. This unblocks the thread that had called the <a class="el" href="classPSyncPointAck.html#a0">Signal()</a> function to initiate the action. </td> </tr></table><a name="a1" doxytag="PSyncPointAck::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"> void PSyncPointAck::Signal </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>waitTime</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="a0" doxytag="PSyncPointAck::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 PSyncPointAck::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>Unlike the <a class="el" href="classPSemaphore.html#z347_2">PSyncPoint::Signal()</a> this function will block until the target thread that was blocked by the <a class="el" href="classPSemaphore.html#z347_0">Wait()</a> function has resumed execution and called the <a class="el" href="classPSyncPointAck.html#a2">Acknowledge()</a> function.<p>The waitTime# parameter is used as a maximum amount of time to wait for the achnowledgement to be returned from the other thread. <p>Reimplemented from <a class="el" href="classPSemaphore.html#z347_2">PSemaphore</a>. </td> </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PSyncPointAck::ack"></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="classPSyncPoint.html">PSyncPoint</a> PSyncPointAck::ack<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="syncthrd_8h-source.html">syncthrd.h</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:20 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 + -