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

# ACE_Thread_Exit Class Reference

Keep exit information for a Thread in thread specific storage. so that the thread-specific exit hooks will get called no matter how the thread exits (e.g., via <ACE_Thread::exit>, C++ or Win32 exception, "falling off the end" of the thread entry point function, etc.). More...

`#include <Thread_Exit.h>`

Collaboration diagram for ACE_Thread_Exit:

[legend]
List of all members.

## Public Methods
| ACE_Thread_Exit (void)
| Capture the Thread that will be cleaned up automatically. More...
void | thr_mgr (ACE_Thread_Manager *tm)
| Set the <ACE_Thread_Manager>. More...
| ~ACE_Thread_Exit (void)
| Destructor calls the thread-specific exit hooks when a thread exits. More...
## Static Public Methods
ACE_Thread_Exit * | instance (void)
| Singleton access point. More...
void | cleanup (void *instance, void *)
| Cleanup method, used by the <ACE_Object_Manager> to destroy the singleton. More...
## Private Attributes
ACE_Thread_Control | thread_control_
| Automatically add/remove the thread from the <ACE_Thread_Manager>. More...
## Static Private Attributes
u_int | is_constructed_ = 0
## Friends
class | ACE_OS_Object_Manager
| Allow OS_Object_Manager to reset the status of <is_constructed_>. More...

## Detailed Description

Keep exit information for a Thread in thread specific storage. so that the thread-specific exit hooks will get called no matter how the thread exits (e.g., via <ACE_Thread::exit>, C++ or Win32 exception, "falling off the end" of the thread entry point function, etc.).

This clever little helper class is stored in thread-specific storage using the <ACE_TSS> wrapper. When a thread exits the <ACE_TSS::cleanup> function deletes this object, thereby closing it down gracefully.

## Constructor & Destructor Documentation

ACE_Thread_Exit::ACE_Thread_Exit | ( | void |  | ) |

| Capture the Thread that will be cleaned up automatically.

ACE_Thread_Exit::~ACE_Thread_Exit | ( | void |  | ) |

| Destructor calls the thread-specific exit hooks when a thread exits.

## Member Function Documentation

void ACE_Thread_Exit::cleanup | ( | void * | instance,
|  | void * |
| ) | `[static]`

| Cleanup method, used by the <ACE_Object_Manager> to destroy the singleton.

ACE_Thread_Exit * ACE_Thread_Exit::instance | ( | void |  | ) | `[static]`

| Singleton access point.

void ACE_Thread_Exit::thr_mgr | ( | ACE_Thread_Manager * | tm | ) |

| Set the <ACE_Thread_Manager>.

## Friends And Related Function Documentation

friend class ACE_OS_Object_Manager`[friend]`

| Allow OS_Object_Manager to reset the status of <is_constructed_>.

## Member Data Documentation

u_int ACE_Thread_Exit::is_constructed_ = 0`[static, private]`

| Used to detect whether we should create a new instance (or not) within the instance method -- we don't trust the instance_ ptr because the destructor may have run (if ACE::fini() was called). See bug #526. We don't follow the singleton pattern due to dependency issues.

ACE_Thread_Control ACE_Thread_Exit::thread_control_`[private]`

| Automatically add/remove the thread from the <ACE_Thread_Manager>.

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

- Thread_Exit.h
- Thread_Exit.cpp