ACE  6.3.3
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ACE_Thread_Descriptor Class Reference

Information for controlling threads that run under the control of the <Thread_Manager>. More...

#include <Thread_Manager.h>

Inheritance diagram for ACE_Thread_Descriptor:
Inheritance graph
[legend]
Collaboration diagram for ACE_Thread_Descriptor:
Collaboration graph
[legend]

Public Member Functions

 ACE_Thread_Descriptor (void)
 
ACE_thread_t self (void) const
 Unique thread id. More...
 
void self (ACE_hthread_t &)
 Unique handle to thread (used by Win32 and AIX). More...
 
void dump (void) const
 Dump the state of an object. More...
 
void log_msg_cleanup (ACE_Log_Msg *log_msg)
 
int at_exit (ACE_At_Thread_Exit *cleanup)
 
int at_exit (ACE_At_Thread_Exit &cleanup)
 
int at_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param)
 
 ~ACE_Thread_Descriptor (void)
 Do nothing destructor to keep some compilers happy. More...
 
void acquire_release (void)
 
void acquire (void)
 
void release (void)
 
void set_next (ACE_Thread_Descriptor *td)
 
ACE_Thread_Descriptorget_next (void) const
 
- Public Member Functions inherited from ACE_Thread_Descriptor_Base
 ACE_Thread_Descriptor_Base (void)
 
virtual ~ACE_Thread_Descriptor_Base (void)
 
bool operator== (const ACE_Thread_Descriptor_Base &rhs) const
 Equality operator. More...
 
bool operator!= (const ACE_Thread_Descriptor_Base &rhs) const
 Inequality operator. More...
 
int grp_id (void) const
 Group ID. More...
 
ACE_UINT32 state (void) const
 Current state of the thread. More...
 
ACE_Task_Basetask (void) const
 
- Public Member Functions inherited from ACE_OS_Thread_Descriptor
long flags (void) const
 Get the thread creation flags. More...
 
virtual ~ACE_OS_Thread_Descriptor (void)
 

Private Member Functions

void reset (ACE_Thread_Manager *tm)
 Reset this thread descriptor. More...
 
void at_pop (int apply=1)
 
void at_push (ACE_At_Thread_Exit *cleanup, bool is_owner=false)
 
void do_at_exit (void)
 Run the AT_Thread_Exit hooks. More...
 
void terminate (void)
 Terminate realize the cleanup process to thread termination. More...
 

Private Attributes

ACE_Log_Msglog_msg_
 
ACE_At_Thread_Exitat_exit_list_
 The AT_Thread_Exit list. More...
 
ACE_Thread_Managertm_
 
ACE_DEFAULT_THREAD_MANAGER_LOCKsync_
 Registration lock to prevent premature removal of thread descriptor. More...
 
bool terminated_
 Keep track of termination status. More...
 

Friends

class ACE_At_Thread_Exit
 
class ACE_Thread_Manager
 
class ACE_Double_Linked_List< ACE_Thread_Descriptor >
 
class ACE_Double_Linked_List_Iterator< ACE_Thread_Descriptor >
 

Additional Inherited Members

- Protected Member Functions inherited from ACE_Thread_Descriptor_Base
void reset (void)
 Reset this base thread descriptor. More...
 
- Protected Member Functions inherited from ACE_OS_Thread_Descriptor
 ACE_OS_Thread_Descriptor (long flags=0)
 For use by ACE_Thread_Descriptor. More...
 
- Protected Attributes inherited from ACE_Thread_Descriptor_Base
ACE_thread_t thr_id_
 Unique thread ID. More...
 
ACE_hthread_t thr_handle_
 Unique handle to thread (used by Win32 and AIX). More...
 
int grp_id_
 Group ID. More...
 
ACE_UINT32 thr_state_
 Current state of the thread. More...
 
ACE_Task_Basetask_
 
ACE_Thread_Descriptor_Basenext_
 
ACE_Thread_Descriptor_Baseprev_
 
- Protected Attributes inherited from ACE_OS_Thread_Descriptor
long flags_
 

Detailed Description

Information for controlling threads that run under the control of the <Thread_Manager>.

Constructor & Destructor Documentation

ACE_Thread_Descriptor::ACE_Thread_Descriptor ( void  )
ACE_Thread_Descriptor::~ACE_Thread_Descriptor ( void  )

Do nothing destructor to keep some compilers happy.

Member Function Documentation

void ACE_Thread_Descriptor::acquire ( void  )
void ACE_Thread_Descriptor::acquire_release ( void  )

Do nothing but to acquire the thread descriptor's lock and release. This will first check if the thread is registered or not. If it is already registered, there's no need to reacquire the lock again. This is used mainly to get newly spawned thread in synch with thread manager and prevent it from accessing its thread descriptor before it gets fully built. This function is only called from ACE_Log_Msg::thr_desc.

int ACE_Thread_Descriptor::at_exit ( ACE_At_Thread_Exit cleanup)

Register an At_Thread_Exit hook and the ownership is acquire by Thread_Descriptor, this is the usual case when the AT is dynamically allocated.

int ACE_Thread_Descriptor::at_exit ( ACE_At_Thread_Exit cleanup)

Register an At_Thread_Exit hook and the ownership is retained for the caller. Normally used when the at_exit hook is created in stack.

int ACE_Thread_Descriptor::at_exit ( void *  object,
ACE_CLEANUP_FUNC  cleanup_hook,
void *  param 
)

Register an object (or array) for cleanup at thread termination. "cleanup_hook" points to a (global, or static member) function that is called for the object or array when it to be destroyed. It may perform any necessary cleanup specific for that object or its class. "param" is passed as the second parameter to the "cleanup_hook" function; the first parameter is the object (or array) to be destroyed. Returns 0 on success, non-zero on failure: -1 if virtual memory is exhausted or 1 if the object (or arrayt) had already been registered.

void ACE_Thread_Descriptor::at_pop ( int  apply = 1)
private

Pop an At_Thread_Exit from at thread termination list, apply the at if apply is true.

void ACE_Thread_Descriptor::at_push ( ACE_At_Thread_Exit cleanup,
bool  is_owner = false 
)
private

Push an At_Thread_Exit to at thread termination list and set the ownership of at.

void ACE_Thread_Descriptor::do_at_exit ( void  )
private

Run the AT_Thread_Exit hooks.

void ACE_Thread_Descriptor::dump ( void  ) const

Dump the state of an object.

ACE_Thread_Descriptor * ACE_Thread_Descriptor::get_next ( void  ) const
inline
void ACE_Thread_Descriptor::log_msg_cleanup ( ACE_Log_Msg log_msg)
inline

This cleanup function must be called only for ACE_TSS_cleanup. The ACE_TSS_cleanup delegate Log_Msg instance destruction when Log_Msg cleanup is called before terminate.

void ACE_Thread_Descriptor::release ( void  )
void ACE_Thread_Descriptor::reset ( ACE_Thread_Manager tm)
inlineprivate

Reset this thread descriptor.

ACE_thread_t ACE_Thread_Descriptor::self ( void  ) const
inline

Unique thread id.

void ACE_Thread_Descriptor::self ( ACE_hthread_t handle)
inline

Unique handle to thread (used by Win32 and AIX).

void ACE_Thread_Descriptor::set_next ( ACE_Thread_Descriptor td)
inline

Set/get the next_ pointer. These are required by the ACE_Free_List.

void ACE_Thread_Descriptor::terminate ( void  )
private

Terminate realize the cleanup process to thread termination.

Friends And Related Function Documentation

friend class ACE_At_Thread_Exit
friend
friend class ACE_Thread_Manager
friend

Member Data Documentation

ACE_At_Thread_Exit* ACE_Thread_Descriptor::at_exit_list_
private

The AT_Thread_Exit list.

ACE_Log_Msg* ACE_Thread_Descriptor::log_msg_
private

Thread_Descriptor is the ownership of ACE_Log_Msg if log_msg_!=0 This can occur because ACE_TSS_cleanup was executed before terminate.

ACE_DEFAULT_THREAD_MANAGER_LOCK* ACE_Thread_Descriptor::sync_
private

Registration lock to prevent premature removal of thread descriptor.

bool ACE_Thread_Descriptor::terminated_
private

Keep track of termination status.

ACE_Thread_Manager* ACE_Thread_Descriptor::tm_
private

Pointer to an ACE_Thread_Manager or NULL if there's no ACE_Thread_Manager>


The documentation for this class was generated from the following files: