Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 68d373e54fb21da3730c08bede406633 > files > 384

libCommonC++1.9_3-devel-1.9.4-2mdk.i586.rpm

<!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>Thread class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.10 -->
<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="classes.html">Alphabetical List</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="namespacemembers.html">Namespace Members</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>Thread  Class Reference</h1>Every thread of execution in an application is created by deriving a unique class from the Thread class and by implementing the Run method. base class used to derive all threads of execution. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="thread_8h-source.html">thread.h</a>&gt;</code>
<p>
<p>Inheritance diagram for Thread::
<p><center><img src="class_thread.gif" usemap="#Thread_map" border="0"></center>
<map name="Thread_map">
<area href="class_f_i_f_o_session.html" alt="FIFOSession" shape="rect" coords="0,56,94,80">
<area href="class_posix_thread.html" alt="PosixThread" shape="rect" coords="104,56,198,80">
<area href="class_serial_service.html" alt="SerialService" shape="rect" coords="208,56,302,80">
<area href="class_socket_service.html" alt="SocketService" shape="rect" coords="312,56,406,80">
<area href="class_t_c_p_session.html" alt="TCPSession" shape="rect" coords="416,56,510,80">
<area href="class_t_t_y_session.html" alt="TTYSession" shape="rect" coords="520,56,614,80">
</map>
<a href="class_thread-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a0">CCXX_MEMBER_EXPORT</a> (CCXX_EMPTY) Thread(bool isMain)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This is actually a special constructor that is used to create a thread "object" for the current execution context when that context is not created via an instance of a derived Thread object itself.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a1">CCXX_MEMBER_EXPORT</a> (CCXX_EMPTY) Thread(int pri=0, size_t stack=0)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>When a thread object is contructed, a new thread of execution context is created.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a2">Thread</a> (const Thread &amp;th)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>A thread of execution can also be specified by cloning an existing thread.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a3">CCXX_MEMBER_EXPORT</a> (virtual)~Thread()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>The thread destructor should clear up any resources that have been allocated by the thread.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a4">CCXX_MEMBER_EXPORT</a> (int) Start(<a class="el" href="class_semaphore.html">Semaphore</a> *start=0)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>When a new thread is created, it does not begin immediate execution.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a5">CCXX_MEMBER_EXPORT</a> (int) Detach(<a class="el" href="class_semaphore.html">Semaphore</a> *start=0)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Start a new thread as "detached".</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>Thread *&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a6">getParent</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Gets the pointer to the Thread class which created the current thread object.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a7">CCXX_MEMBER_EXPORT</a> (void) Suspend(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Suspends execution of the selected thread.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a8">CCXX_MEMBER_EXPORT</a> (void) Resume(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Resumes execution of the selected thread.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="thread_8h.html#a56">thread_cancel_t</a>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a9">getCancel</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Used to retrieve the cancellation mode in effect for the selected thread.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a10">isRunning</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Verifies if the thread is still running or has already been terminated but not yet deleted.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a11">isThread</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Tests to see if the current execution context is the same as the specified thread object.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>friend&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a12">CCXX_EXPORT</a> (<a class="el" href="thread_8h.html#a55">throw_t</a>) getException(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get exception mode of the current thread.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>friend&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a13">CCXX_EXPORT</a> (void) setException(<a class="el" href="thread_8h.html#a55">throw_t</a> mode)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set exception mode of the current thread.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>friend&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#a14">CCXX_EXPORT</a> (void) ccxx_sleep(<a class="el" href="thread_8h.html#a10">timeout_t</a> msec)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Thread safe sleep call replacement.</em> <a href="#a14">More...</a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b0">Run</a> (void)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>All threads execute by deriving the Run method of Thread.</em> <a href="#b0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b1">CCXX_MEMBER_EXPORT</a> (virtual void) Final(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>A thread that is self terminating, either by invoking <a class="el" href="class_thread.html#b6">Exit</a>() or leaving it's <a class="el" href="class_thread.html#b0">Run</a>(), will have this method called.</em> <a href="#b1">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b2">CCXX_MEMBER_EXPORT</a> (virtual void) Initial(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>The initial method is called by a newly created thread when it starts execution.</em> <a href="#b2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b3">CCXX_MEMBER_EXPORT</a> (virtual void *) getExtended(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Since <a class="el" href="class_thread.html#a6">getParent</a>() and <a class="el" href="class_thread.html#l4">getThread</a> only refer to an object of the Thread "base" type, this virtual method can be replaced in a derived class with something that returns data specific to the derived class that can still be accessed through the pointer returned by <a class="el" href="class_thread.html#a6">getParent</a>() and <a class="el" href="class_thread.html#l4">getThread</a>.</em> <a href="#b3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b4">CCXX_MEMBER_EXPORT</a> (virtual void) Notify(Thread *th)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>When a thread terminates, it now sends a notification message to the parent thread which created it.</em> <a href="#b4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b5">CCXX_MEMBER_EXPORT</a> (void) Sleep(<a class="el" href="thread_8h.html#a10">timeout_t</a> msec)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>A thread-safe sleep call.</em> <a href="#b5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b6">Exit</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Used to properly exit from a Thread derived <a class="el" href="class_thread.html#b0">Run</a>() or Initial() method.</em> <a href="#b6">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b7">CCXX_MEMBER_EXPORT</a> (void) Yield(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Yields the current thread's CPU time slice to allow another thread to begin immediate execution.</em> <a href="#b7">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b8">CCXX_MEMBER_EXPORT</a> (void) testCancel(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>test a cancellation point for deferred thread cancellation.</em> <a href="#b8">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b9">CCXX_MEMBER_EXPORT</a> (void) setCancel(<a class="el" href="thread_8h.html#a56">thread_cancel_t</a> mode)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Sets thread cancellation mode.</em> <a href="#b9">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b10">CCXX_MEMBER_EXPORT</a> (void) setSuspend(<a class="el" href="thread_8h.html#a57">thread_suspend_t</a> mode)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Sets the thread's ability to be suspended from execution.</em> <a href="#b10">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b11">CCXX_MEMBER_EXPORT</a> (void) Terminate(void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Used by another thread to terminate the current thread.</em> <a href="#b11">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#b12">clrParent</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>clear parent thread relationship.</em> <a href="#b12">More...</a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Friends</h2></td></tr>
<tr><td nowrap align=right valign=top>class&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l0">PosixThread</a></td></tr>
<tr><td nowrap align=right valign=top>class&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l1">Slog</a></td></tr>
<tr><td nowrap align=right valign=top>RETSIGTYPE&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l2">ccxx_sigsuspend</a> (int)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l3">execHandler</a> (Thread *th)</td></tr>
<tr><td nowrap align=right valign=top>Thread *&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l4">getThread</a> (void)</td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l5">start</a> (Thread &amp;th, <a class="el" href="class_semaphore.html">Semaphore</a> *start=0)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Start execution of a specified thread.</em> <a href="#l5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l6">operator++</a> (Thread &amp;th)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Signal the semaphore that the specified thread is waiting for before beginning execution.</em> <a href="#l6">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_thread.html#l7">operator--</a> (Thread &amp;th)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Every thread of execution in an application is created by deriving a unique class from the Thread class and by implementing the Run method. base class used to derive all threads of execution.
<p>
The base Thread class supports encapsulation of the generic threading methods implemented on various target operating systems.  This includes the ability to start and stop threads in a synchronized and controllable manner, the ability to specify thread execution priority, and thread specific "system call" wrappers, such as for sleep and yield. A thread exception is thrown if the thread cannot be created. Threading was the first part of Common C++ I wrote, back when it was still the APE library. My goal for Common C++ threading has been to make threading as natural and easy to use in C++ application development as threading is in Java. With this said, one does not need to use threading at all to take advantage of Common C++. However, all Common C++ classes are designed at least to be thread-aware/thread-safe as appropriate and necessary.
<p>
Common C++ threading is currently built either from the Posix "pthread" library or using the win32 SDK. In that the Posix "pthread" draft has gone through many revisions, and many system implementations are only marginally compliant, and even then usually in different ways, I wrote a large series of autoconf macros found in ost_pthread.m4 which handle the task of identifying which pthread features and capabilities your target platform supports. In the process I learned much about what autoconf can and cannot do for you..
<p>
Currently the GNU Portable Thread library (GNU pth) is not directly supported in Common C++. While GNU "Pth" doesn't offer direct native threading support or benefit from SMP hardware, many of the design advantages of threading can be gained from it's use, and the Pth pthread "emulation" library should be usable with Common C++. In the future, Common C++ will directly support Pth, as well as OS/2 and BeOS native threading API's.
<p>
Common C++ itself defines a fairly "neutral" threading model that is not tied to any specific API such as pthread, win32, etc. This neutral thread model is contained in a series of classes which handle threading and synchronization and which may be used together to build reliable threaded applications.
<p>
Common C++ defines application specific threads as objects which are derived from the Common C++ "Thread" base class. At minimum the "Run" method must be implemented, and this method essentially is the "thread", for it is executed within the execution context of the thread, and when the Run method terminates the thread is assumed to have terminated.
<p>
Common C++ allows one to specify the running priority of a newly created thread relative to the "parent" thread which is the thread that is executing when the constructor is called. Since most newer C++ implementations do not allow one to call virtual constructors or virtual methods from constructors, the thread must be "started" after the constructor returns. This is done either by defining a "starting" semaphore object that one or more newly created thread objects can wait upon, or by invoking an explicit "Start" member function.
<p>
Threads can be "suspended" and "resumed". As this behavior is not defined in the Posix "pthread" specification, it is often emulated through signals. Typically SIGUSR1 will be used for this purpose in Common C++ applications, depending in the target platform. On Linux, since threads are indeed processes, SIGSTP and SIGCONT can be used. On solaris, the Solaris thread library supports suspend and resume directly.
<p>
Threads can be canceled. Not all platforms support the concept of externally cancelable threads. On those platforms and API implementations that do not, threads are typically canceled through the action of a signal handler.
<p>
As noted earlier, threads are considered running until the "Run" method returns, or until a cancellation request is made. Common C++ threads can control how they respond to cancellation, using setCancellation(). Cancellation requests can be ignored, set to occur only when a cancellation "point" has been reached in the code, or occur immediately. Threads can also exit by returning from <a class="el" href="class_thread.html#b0">Run</a>() or by invoking the <a class="el" href="class_thread.html#b6">Exit</a>() method.
<p>
Generally it is a good practice to initialize any resources the thread may require within the constructor of your derived thread class, and to purge or restore any allocated resources in the destructor. In most cases, the destructor will be executed after the thread has terminated, and hence will execute within the context of the thread that requested a join rather than in the context of the thread that is being terminated. Most destructors in derived thread classes should first call Terminate() to make sure the thread has stopped running before releasing resources.
<p>
A Common C++ thread is normally canceled by deleting the thread object. The process of deletion invokes the thread's destructor, and the destructor will then perform a "join" against the thread using the Terminate() function. This behavior is not always desirable since the thread may block itself from cancellation and block the current "delete" operation from completing. One can alternately invoke Terminate() directly before deleting a thread object.
<p>
When a given Common C++ thread exits on it's own through it's <a class="el" href="class_thread.html#b0">Run</a>() method, a "Final" method will be called. This Final method will be called while the thread is "detached". If a thread object is constructed through a "new" operator, it's final method can be used to "self delete" when done, and allows an independent thread to construct and remove itself autonomously.
<p>
A special global function, <a class="el" href="class_thread.html#l4">getThread</a>, is provided to identify the thread object that represents the current execution context you are running under. This is sometimes needed to deliver signals to the correct thread. Since all thread manipulation should be done through the Common C++ (base)  thread class itself, this provides the same functionality as things like "pthread_self" for Common C++.
<p>
Common C++ threads are often aggregated into other classes to provide services that are "managed" from or operate within the context of a thread, even within the Common C++ framework itself. A good example of this is the <a class="el" href="class_t_c_p_session.html">TCPSession</a> class, which essentially is a combination of a TCP client connection and a separate thread the user can define by deriving a class with a <a class="el" href="class_thread.html#b0">Run</a>() method to handle the connected service. This aggregation logically connects the successful allocation of a given resource with the construction of a thread to manage and perform  operations for said resource.
<p>
Threads are also used in "service pools". In Common C++, a service pool is one or more threads that are used to manage a set of resources. While Common C++ does not provide a direct "pool" class, it does provide a model for their implementation, usually by constructing an array of thread "service" objects, each of which can then be assigned the next new instance of a given resource in turn or algorithmically.
<p>
Threads have signal handlers associated with them. Several signal types are "predefined" and have special meaning. All signal handlers are defined as virtual member functions of the Thread class which are called when a specific signal is received for a given thread. The "SIGPIPE" event is defined as a "Disconnect" event since it's normally associated with a socket disconnecting or broken fifo. The Hangup() method is associated with the SIGHUP signal. All other signals are handled through the more generic Signal().
<p>
Incidently, unlike Posix, the win32 API has no concept of signals, and certainly no means to define or deliver signals on a per-thread basis. For this reason, no signal handling is supported or emulated in the win32 implementation of Common C++ at this time.
<p>
In addition to <a class="el" href="class_t_c_p_stream.html">TCPStream</a>, there is a <a class="el" href="class_t_c_p_session.html">TCPSession</a> class which combines a thread with a <a class="el" href="class_t_c_p_stream.html">TCPStream</a> object. The assumption made by <a class="el" href="class_t_c_p_session.html">TCPSession</a> is that one will service each TCP connection with a separate thread, and this makes sense for systems where extended connections may be maintained and complex protocols are being used over TCP.
<p>
<dl compact><dt><b>
Author: </b><dd>
David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; </dl>
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a2" doxytag="Thread::Thread"></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"> Thread::Thread </td>
          <td class="md">(&nbsp;</td>
          <td class="md">const Thread &amp;</td>
          <td class="mdname1">&nbsp; <em>th</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A thread of execution can also be specified by cloning an existing thread.
<p>
The existing thread's properties (cancel mode, priority, etc), are also duplicated.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>th
</em>&nbsp;</td><td>
currently executing thread object to clone. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a14" doxytag="Thread::CCXX_EXPORT"></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"> Thread::CCXX_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Thread safe sleep call replacement.
<p>
This is mapped into <a class="el" href="thread_8h.html#a7">sleep</a>().<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>msec
</em>&nbsp;</td><td>
timeout in millisecond time range. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a13" doxytag="Thread::CCXX_EXPORT"></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"> Thread::CCXX_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set exception mode of the current thread.
<p>
<dl compact><dt><b>
Returns: </b><dd>
exception mode. </dl>    </td>
  </tr>
</table>
<a name="a12" doxytag="Thread::CCXX_EXPORT"></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"> Thread::CCXX_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md"><a class="el" href="thread_8h.html#a55">throw_t</a></td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get exception mode of the current thread.
<p>
<dl compact><dt><b>
Returns: </b><dd>
exception mode. </dl>    </td>
  </tr>
</table>
<a name="a8" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Resumes execution of the selected thread.
<p>
    </td>
  </tr>
</table>
<a name="a7" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Suspends execution of the selected thread.
<p>
Pthreads do not normally support suspendable threads, so the behavior is simulated with signals. On systems such as Linux that define threads as processes, SIGSTOP and SIGCONT may be used.     </td>
  </tr>
</table>
<a name="a5" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">int</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Start a new thread as "detached".
<p>
This is an alternative Start() method that resolves some issues with later glibc implimentations which incorrectly impliment self-detach.
<p>
<dl compact><dt><b>
Returns: </b><dd>
error code if execution fails. </dl><dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>start
</em>&nbsp;</td><td>
optional starting semaphore to alternately use. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a4" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">int</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
When a new thread is created, it does not begin immediate execution.
<p>
This is because the derived class virtual tables are not properly loaded at the time the C++ object is created within the constructor itself, at least in some compiler/system  combinations. The thread can either be told to wait for an external semaphore, or it can be started directly after the constructor completes by calling the Start() method.
<p>
<dl compact><dt><b>
Returns: </b><dd>
error code if execution fails. </dl><dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>start
</em>&nbsp;</td><td>
optional starting semaphore to alternately use. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a3" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">virtual</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The thread destructor should clear up any resources that have been allocated by the thread.
<p>
The desctructor of a derived thread should begin with Terminate() and is presumed to then execute within the context of the thread causing terminaton.     </td>
  </tr>
</table>
<a name="a1" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">CCXX_EMPTY</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
When a thread object is contructed, a new thread of execution context is created.
<p>
This constructor allows basic properties of that context (thread priority, stack space, etc) to be defined. The starting condition is also specified for whether the thread is to wait on a semaphore before begining execution or wait until it's start method is called.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>start
</em>&nbsp;</td><td>
semaphore to wait before executing thread. </td></tr>
<tr><td valign=top><em>pri
</em>&nbsp;</td><td>
thread base priority relative to it's parent. </td></tr>
<tr><td valign=top><em>stack
</em>&nbsp;</td><td>
space as needed in some implementations. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a0" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">CCXX_EMPTY</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This is actually a special constructor that is used to create a thread "object" for the current execution context when that context is not created via an instance of a derived Thread object itself.
<p>
This constructor does not support First.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>bool
</em>&nbsp;</td><td>
used if the main "thread" of the application. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b11" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Used by another thread to terminate the current thread.
<p>
Termination actually occurs based on the current setCancel() mode. When the current thread does terminate, control is returned to the requesting thread. Terminate() should always be called at the start of any destructor of a class derived from Thread to assure the remaining part of the destructor is called without the thread still executing.     </td>
  </tr>
</table>
<a name="b10" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Sets the thread's ability to be suspended from execution.
<p>
The thread may either have suspend enabled (THREAD_SUSPEND_ENABLE) or disabled (THREAD_SUSPEND_DISABLE).<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>mode
</em>&nbsp;</td><td>
for suspend. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b9" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Sets thread cancellation mode.
<p>
Threads can either be set immune to termination (THREAD_CANCEL_DISABLED), can be set to terminate when reaching specific "thread cancellation points" (THREAD_CANCEL_DEFERRED) or immediately when Terminate is requested (THREAD_CANCEL_IMMEDIATE).<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>mode
</em>&nbsp;</td><td>
for cancellation of the current thread. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b8" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
test a cancellation point for deferred thread cancellation.
<p>
    </td>
  </tr>
</table>
<a name="b7" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Yields the current thread's CPU time slice to allow another thread to begin immediate execution.
<p>
    </td>
  </tr>
</table>
<a name="b5" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A thread-safe sleep call.
<p>
On most Posix systems, "<a class="el" href="thread_8h.html#a7">sleep</a>()" is implimented with SIGALRM making it unusable from multipe threads. Pthread libraries often define an alternate "sleep" handler such as usleep(), nanosleep(), or nap(), that is thread safe, and also offers a higher timer resolution.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>msec
</em>&nbsp;</td><td>
timeout in milliseconds. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b4" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">virtual</td>
          <td class="mdname1">&nbsp; <em>void</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
When a thread terminates, it now sends a notification message to the parent thread which created it.
<p>
The actual use of this notification is left to be defined in a derived class.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>th
</em>&nbsp;</td><td>
the thread that has terminated. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b3" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">virtual void *</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Since <a class="el" href="class_thread.html#a6">getParent</a>() and <a class="el" href="class_thread.html#l4">getThread</a> only refer to an object of the Thread "base" type, this virtual method can be replaced in a derived class with something that returns data specific to the derived class that can still be accessed through the pointer returned by <a class="el" href="class_thread.html#a6">getParent</a>() and <a class="el" href="class_thread.html#l4">getThread</a>.
<p>
<dl compact><dt><b>
Returns: </b><dd>
pointer to derived class specific data. </dl>    </td>
  </tr>
</table>
<a name="b2" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">virtual</td>
          <td class="mdname1">&nbsp; <em>void</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The initial method is called by a newly created thread when it starts execution.
<p>
This method is ran with deferred cancellation disabled by default. The Initial method is given a seperate handler so that it can create temporary objects on it's own stack frame, rather than having objects created on <a class="el" href="class_thread.html#b0">Run</a>() that are only needed by startup and yet continue to consume stack space.
<p>
<dl compact><dt><b>
See also: </b><dd>
<a class="el" href="class_thread.html#b0">Run</a> </dl>    </td>
  </tr>
</table>
<a name="b1" doxytag="Thread::CCXX_MEMBER_EXPORT"></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"> Thread::CCXX_MEMBER_EXPORT </td>
          <td class="md">(&nbsp;</td>
          <td class="md">virtual</td>
          <td class="mdname1">&nbsp; <em>void</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A thread that is self terminating, either by invoking <a class="el" href="class_thread.html#b6">Exit</a>() or leaving it's <a class="el" href="class_thread.html#b0">Run</a>(), will have this method called.
<p>
It can be used to self delete the current object assuming the object was created with new on the heap rather than stack local, hence one may often see Final defined as "delete this" in a derived thread class. A Final method, while running, cannot be terminated or cancelled by another thread.
<p>
<dl compact><dt><b>
See also: </b><dd>
<a class="el" href="class_thread.html#b6">Exit</a> , <a class="el" href="class_thread.html#b0">Run</a> </dl>    </td>
  </tr>
</table>
<a name="b6" doxytag="Thread::Exit"></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 Thread::Exit </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Used to properly exit from a Thread derived <a class="el" href="class_thread.html#b0">Run</a>() or Initial() method.
<p>
Terminates execution of the current thread and calls the derived classes Final() method.     </td>
  </tr>
</table>
<a name="b0" doxytag="Thread::Run"></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 Thread::Run </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected, pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
All threads execute by deriving the Run method of Thread.
<p>
This method is called after Initial to begin normal operation of the thread. If the method terminates, then the thread will also terminate after notifying it's parent and calling it's Final() method.
<p>
<dl compact><dt><b>
See also: </b><dd>
Initial </dl>    </td>
  </tr>
</table>
<a name="b12" doxytag="Thread::clrParent"></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 Thread::clrParent </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
clear parent thread relationship.
<p>
    </td>
  </tr>
</table>
<a name="a9" doxytag="Thread::getCancel"></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#a56">thread_cancel_t</a> Thread::getCancel </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Used to retrieve the cancellation mode in effect for the selected thread.
<p>
<dl compact><dt><b>
Returns: </b><dd>
cancellation mode constant. </dl>    </td>
  </tr>
</table>
<a name="a6" doxytag="Thread::getParent"></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"> Thread* Thread::getParent </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Gets the pointer to the Thread class which created the current thread object.
<p>
<dl compact><dt><b>
Returns: </b><dd>
a Thread *, or "(Thread *)this" if no parent. </dl>    </td>
  </tr>
</table>
<a name="a10" doxytag="Thread::isRunning"></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 Thread::isRunning </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Verifies if the thread is still running or has already been terminated but not yet deleted.
<p>
<dl compact><dt><b>
Returns: </b><dd>
true if the thread is still executing. </dl>    </td>
  </tr>
</table>
<a name="a11" doxytag="Thread::isThread"></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 Thread::isThread </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Tests to see if the current execution context is the same as the specified thread object.
<p>
<dl compact><dt><b>
Returns: </b><dd>
true if the current context is this object. </dl>    </td>
  </tr>
</table>
<hr><h2>Friends And Related Function Documentation</h2>
<a name="l0" doxytag="Thread::PosixThread"></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 PosixThread<code> [friend]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a name="l1" doxytag="Thread::Slog"></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 Slog<code> [friend]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a name="l2" doxytag="Thread::ccxx_sigsuspend"></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"> RETSIGTYPE ccxx_sigsuspend </td>
          <td class="md">(&nbsp;</td>
          <td class="md">int</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [friend]</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="l3" doxytag="Thread::execHandler"></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 execHandler </td>
          <td class="md">(&nbsp;</td>
          <td class="md">Thread *</td>
          <td class="mdname1">&nbsp; <em>th</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [friend]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Reimplemented in <a class="el" href="class_posix_thread.html#l0">PosixThread</a>.    </td>
  </tr>
</table>
<a name="l4" doxytag="Thread::getThread"></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"> Thread* getThread </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [friend]</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="l6" doxytag="Thread::operator++"></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 operator++ </td>
          <td class="md">(&nbsp;</td>
          <td class="md">Thread &amp;</td>
          <td class="mdname1">&nbsp; <em>th</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [friend]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Signal the semaphore that the specified thread is waiting for before beginning execution.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>th
</em>&nbsp;</td><td>
specified thread. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="l7" doxytag="Thread::operator--"></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 operator-- </td>
          <td class="md">(&nbsp;</td>
          <td class="md">Thread &amp;</td>
          <td class="mdname1">&nbsp; <em>th</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [friend]</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="l5" doxytag="Thread::start"></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"> int start </td>
          <td class="md">(&nbsp;</td>
          <td class="md">Thread &amp;</td>
          <td class="mdname">&nbsp; <em>th</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md"><a class="el" href="class_semaphore.html">Semaphore</a> *</td>
          <td class="mdname">&nbsp; <em>start</em> = 0</td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [friend]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Start execution of a specified thread.
<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><small>Generated at Tue Nov 20 13:28:51 2001 for CommonC++ by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.10 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>