📄 classpthread.html
字号:
</table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a simple thread executing the specified notifier. This creates a simple PThread class that automatically executes the function defined by the <a class="el" href="classPNotifier.html">PNotifier</a> in the context of a new thread. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>parameter</em> </td><td>Function to execute in thread. </td></tr><tr><td valign=top><em>deletion</em> </td><td>Parameter value to pass to notifier. </td></tr><tr><td valign=top><em>priorityLevel</em> </td><td>Automatically delete PThread instance on termination of thread. </td></tr><tr><td valign=top><em>threadName</em> </td><td>Initial priority of thread. </td></tr><tr><td valign=top><em>stackSize</em> </td><td>The name of the thread (for Debug/Trace) Stack size on some platforms </td></tr></table></dl> </td> </tr></table><a name="z443_3" doxytag="PThread::Current"></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"> PThread* PThread::Current </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>Get the currently running thread object instance. It is possible, even likely, that the smae code may be executed in the context of differenct threads. Under some circumstances it may be necessary to know what the current codes thread is and this static function provides that information.<p><dl compact><dt><b>Returns: </b></dt><dd> pointer to current thread. </dl><p>Reimplemented in <a class="el" href="classPProcess.html#z227_16">PProcess</a>, <a class="el" href="classPServiceProcess.html#z411_2">PServiceProcess</a>, and <a class="el" href="classPHTTPServiceProcess.html#d0">PHTTPServiceProcess</a>. </td> </tr></table><a name="z443_2" doxytag="PThread::GetCurrentThreadId"></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="thread_8h.html#a1">PThreadIdentifier</a> PThread::GetCurrentThreadId </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>Get operating system specific thread identifier for current thread. </td> </tr></table><a name="z441_9" doxytag="PThread::GetPriority"></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 <a class="el" href="classPThread.html#z437_0">Priority</a> PThread::GetPriority </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>Get the current priority of the thread in the current process.<p><dl compact><dt><b>Returns: </b></dt><dd> current thread priority. </dl> </td> </tr></table><a name="z443_0" doxytag="PThread::GetThreadId"></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 <a class="el" href="thread_8h.html#a1">PThreadIdentifier</a> PThread::GetThreadId </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>Get operating system specific thread identifier for this thread. </td> </tr></table><a name="z441_12" doxytag="PThread::GetThreadName"></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 <a class="el" href="classPString.html">PString</a> PThread::GetThreadName </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>Get 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><p>Reimplemented in <a class="el" href="classPProcess.html#z225_1">PProcess</a>. </td> </tr></table><a name="b0" doxytag="PThread::InitialiseProcessThread"></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::InitialiseProcessThread </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> [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="z441_7" doxytag="PThread::IsSuspended"></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 PThread::IsSuspended </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 thread is currently suspended. This checks the suspension count and if greater than zero returns TRUE for a suspended thread.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if thread is suspended. </dl> </td> </tr></table><a name="z441_2" doxytag="PThread::IsTerminated"></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 PThread::IsTerminated </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 thread has been terminated or ran to completion.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the thread has been terminated. </dl> </td> </tr></table><a name="z443_1" doxytag="PThread::Main"></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::Main </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> [pure virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>User override function for the main execution routine of the thread. A descendent class must provide the code that will be executed in the thread within this function.<p>Note that the correct way for a thread to terminate is to return from this function.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -