Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Thread_Control Class Reference

Used to keep track of a thread's activities within its entry point function. More...

#include <Thread_Control.h>

Collaboration diagram for ACE_Thread_Control:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Thread_Control (ACE_Thread_Manager *tm = 0, int insert = 0)
 Initialize the thread control object. If <insert> != 0, then register the thread with the Thread_Manager.

 ~ACE_Thread_Control (void)
 Remove the thread from its associated <Thread_Manager> and exit the thread if <do_thr_exit> is enabled.

void* exit (void *status, int do_thr_exit)
 Remove this thread from its associated <Thread_Manager> and exit the thread if <do_thr_exit> is enabled.

int insert (ACE_Thread_Manager *tm, int insert = 0)
 Store the <Thread_Manager> and use it to register ourselves for correct shutdown.

ACE_Thread_Managerthr_mgr (void)
 Returns the current <Thread_Manager>.

ACE_Thread_Managerthr_mgr (ACE_Thread_Manager *)
 Atomically set a new <Thread_Manager> and return the old <Thread_Manager>.

void* status (void *status)
 Set the exit status (and return existing status).

void* status (void)
 Get the current exit status.

void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

ACE_Thread_Managertm_
 Pointer to the thread manager for this block of code.

void* status_
 Keeps track of the exit status for the thread.


Detailed Description

Used to keep track of a thread's activities within its entry point function.

A uses this class to ensure that threads it spawns automatically register and unregister themselves with it. This class can be stored in thread-specific storage using the wrapper. When a thread exits the function deletes this object, thereby ensuring that it gets removed from its associated .


Constructor & Destructor Documentation

ACE_Thread_Control::ACE_Thread_Control ( ACE_Thread_Manager * tm = 0,
int insert = 0 )
 

Initialize the thread control object. If <insert> != 0, then register the thread with the Thread_Manager.

ACE_Thread_Control::~ACE_Thread_Control ( void )
 

Remove the thread from its associated <Thread_Manager> and exit the thread if <do_thr_exit> is enabled.


Member Function Documentation

void ACE_Thread_Control::dump ( void ) const [inline]
 

Dump the state of an object.

void * ACE_Thread_Control::exit ( void * status,
int do_thr_exit )
 

Remove this thread from its associated <Thread_Manager> and exit the thread if <do_thr_exit> is enabled.

int ACE_Thread_Control::insert ( ACE_Thread_Manager * tm,
int insert = 0 )
 

Store the <Thread_Manager> and use it to register ourselves for correct shutdown.

ACE_INLINE void * ACE_Thread_Control::status ( void )
 

Get the current exit status.

ACE_INLINE void * ACE_Thread_Control::status ( void * s )
 

Set the exit status (and return existing status).

ACE_INLINE ACE_Thread_Manager * ACE_Thread_Control::thr_mgr ( ACE_Thread_Manager * tm )
 

Atomically set a new <Thread_Manager> and return the old <Thread_Manager>.

ACE_INLINE ACE_Thread_Manager * ACE_Thread_Control::thr_mgr ( void )
 

Returns the current <Thread_Manager>.


Member Data Documentation

ACE_Thread_Control::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

void * ACE_Thread_Control::status_ [private]
 

Keeps track of the exit status for the thread.

ACE_Thread_Manager * ACE_Thread_Control::tm_ [private]
 

Pointer to the thread manager for this block of code.


The documentation for this class was generated from the following files:
Generated at Sat Dec 1 11:05:49 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000