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

ACE_OS_Object_Manager_Manager Class Reference

Ensure that the <ACE_OS_Object_Manager> gets initialized at program startup, and destroyed at program termination. More...

List of all members.

Public Methods

 ACE_OS_Object_Manager_Manager (void)
 Constructor. More...

 ~ACE_OS_Object_Manager_Manager (void)
 Destructor. More...


Private Attributes

ACE_thread_t saved_main_thread_id_
 Save the main thread ID, so that destruction can be suppressed. More...


Detailed Description

Ensure that the <ACE_OS_Object_Manager> gets initialized at program startup, and destroyed at program termination.

Without ACE_HAS_NONSTATIC_OBJECT_MANAGER, a static instance of this class is created. Therefore, it gets created before main () is called. And it gets destroyed after main () returns.

Definition at line 6935 of file OS.cpp.


Constructor & Destructor Documentation

ACE_OS_Object_Manager_Manager::ACE_OS_Object_Manager_Manager void   
 

Constructor.

Definition at line 6949 of file OS.cpp.

References ACE_OS_Object_Manager::instance.

06950   : saved_main_thread_id_ (ACE_OS::thr_self ())
06951 {
06952   // Ensure that the Object_Manager gets initialized before any
06953   // application threads have been spawned.  Because this will be called
06954   // during construction of static objects, that should always be the
06955   // case.
06956   (void) ACE_OS_Object_Manager::instance ();
06957 }

ACE_OS_Object_Manager_Manager::~ACE_OS_Object_Manager_Manager void   
 

Destructor.

Definition at line 6959 of file OS.cpp.

References ACE_OS_Object_Manager::instance_, saved_main_thread_id_, ACE_OS::thr_equal, and ACE_OS::thr_self.

06960 {
06961   if (ACE_OS::thr_equal (ACE_OS::thr_self (),
06962                          saved_main_thread_id_))
06963     {
06964       delete ACE_OS_Object_Manager::instance_;
06965       ACE_OS_Object_Manager::instance_ = 0;
06966     }
06967   // else if this destructor is not called by the main thread, then do
06968   // not delete the ACE_OS_Object_Manager.  That causes problems, on
06969   // WIN32 at least.
06970 }


Member Data Documentation

ACE_thread_t ACE_OS_Object_Manager_Manager::saved_main_thread_id_ [private]
 

Save the main thread ID, so that destruction can be suppressed.

Definition at line 6946 of file OS.cpp.

Referenced by ~ACE_OS_Object_Manager_Manager.


The documentation for this class was generated from the following file:
Generated on Mon Jun 16 12:51:50 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002