#include <Thread_Exit.h>
Public Member Functions | |
ACE_Thread_Exit (void) | |
Capture the Thread that will be cleaned up automatically. | |
void | thr_mgr (ACE_Thread_Manager *tm) |
Set the ACE_Thread_Manager. | |
~ACE_Thread_Exit (void) | |
Static Public Member Functions | |
static ACE_Thread_Exit * | instance (void) |
Singleton access point. | |
static void | cleanup (void *instance) |
Private Attributes | |
ACE_Thread_Control | thread_control_ |
Static Private Attributes | |
static bool | is_constructed_ = false |
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.
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.
void ACE_Thread_Exit::thr_mgr | ( | ACE_Thread_Manager * | tm | ) |
Set the ACE_Thread_Manager.
ACE_Thread_Exit * ACE_Thread_Exit::instance | ( | void | ) | [static] |
Singleton access point.
void ACE_Thread_Exit::cleanup | ( | void * | instance | ) | [static] |
Cleanup method, used by the ACE_Object_Manager to destroy the singleton.
Automatically add/remove the thread from the ACE_Thread_Manager.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL bool ACE_Thread_Exit::is_constructed_ = false [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.