📄 classpthread.html
字号:
</table></dl> </td> </tr></table><a name="z441_13" doxytag="PThread::SetThreadName"></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 PThread::SetThreadName </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> & </td> <td class="mdname1" valign="top" nowrap> <em>name</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>Change the name of the thread. Thread names are a optional debugging aid.<p><dl compact><dt><b>Returns: </b></dt><dd> current thread name. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>name</em> </td><td>New name for the thread. </td></tr></table></dl><p>Reimplemented in <a class="el" href="classPProcess.html#z225_2">PProcess</a>. </td> </tr></table><a name="z441_14" doxytag="PThread::Sleep"></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 PThread::Sleep </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>delay</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Suspend the current thread for the specified amount of time.<p><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>delay</em> </td><td>Time interval to sleep for. </td></tr></table></dl> </td> </tr></table><a name="z441_5" doxytag="PThread::Suspend"></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 PThread::Suspend </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">BOOL </td> <td class="mdname1" valign="top" nowrap> <em>susp</em> = TRUE </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>Suspend or resume the thread.<p>If susp# is TRUE this increments an internal count of suspensions that must be matched by an equal number of calls to <a class="el" href="classPThread.html#z441_6">Resume()</a># or Suspend(FALSE)# before the thread actually executes again.<p>If susp# is FALSE then this decrements the internal count of suspensions. If the count is <= 0 then the thread will run. Note that the thread will not be suspended until an equal number of Suspend(TRUE)# calls are made. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>susp</em> </td><td>Flag to suspend or resume a thread. </td></tr></table></dl> </td> </tr></table><a name="z441_1" doxytag="PThread::Terminate"></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 PThread::Terminate </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>Terminate the thread. It is highly recommended that this is not used except in abnormal abort situations as not all clean up of resources allocated to the thread will be executed. This is especially true in C++ as the destructors of objects that are automatic variables are not called causing at the very least the possiblity of memory leaks.<p>Note that the correct way for a thread to terminate is to return from the <a class="el" href="classPThread.html#z443_1">Main()</a># function or self terminate by calling <a class="el" href="classPThread.html#z441_1">Terminate()</a># within the context of the thread which can then assure that all resources are cleaned up. <p>Reimplemented in <a class="el" href="classPProcess.html#z225_0">PProcess</a>, and <a class="el" href="classPServiceProcess.html#a2">PServiceProcess</a>. </td> </tr></table><a name="z441_4" doxytag="PThread::WaitForTermination"></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"> BOOL PThread::WaitForTermination </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>maxWait</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>maxWait</em> </td><td>Maximum time to wait for termination. </td></tr></table></dl> </td> </tr></table><a name="z441_3" doxytag="PThread::WaitForTermination"></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 PThread::WaitForTermination </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>Block and wait for the thread to terminate.<p><dl compact><dt><b>Returns: </b></dt><dd> FALSE if the thread has not terminated and the timeout has expired. </dl> </td> </tr></table><a name="z443_4" doxytag="PThread::Yield"></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 PThread::Yield </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> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Yield to another thread without blocking. This duplicates the implicit thread yield that may occur on some I/O operations or system calls.<p>This may not be implemented on all platforms. </td> </tr></table><hr><h2>Friends And Related Function Documentation</h2><a name="l0" doxytag="PThread::PProcess"></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"> friend class PProcess<code> [friend]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="l1" doxytag="PThread::PTrace::Block"></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"> friend class PTrace::Block<code> [friend]</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="thread_8h-source.html">thread.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 + -