Public Member Functions | |
ACE_Object_Manager_Manager (void) | |
~ACE_Object_Manager_Manager (void) | |
Private Attributes | |
ACE_thread_t | saved_main_thread_id_ |
Save the main thread ID, so that destruction can be suppressed. |
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 774 of file Object_Manager.cpp.
ACE_Object_Manager_Manager::ACE_Object_Manager_Manager | ( | void | ) |
Definition at line 785 of file Object_Manager.cpp.
00786 : saved_main_thread_id_ (ACE_OS::thr_self ()) 00787 { 00788 // Ensure that the Object_Manager gets initialized before any 00789 // application threads have been spawned. Because this will be called 00790 // during construction of static objects, that should always be the 00791 // case. 00792 (void) ACE_Object_Manager::instance (); 00793 }
ACE_Object_Manager_Manager::~ACE_Object_Manager_Manager | ( | void | ) |
Definition at line 795 of file Object_Manager.cpp.
References saved_main_thread_id_, ACE_OS::thr_equal(), and ACE_OS::thr_self().
00796 { 00797 if (ACE_OS::thr_equal (ACE_OS::thr_self (), 00798 saved_main_thread_id_)) 00799 { 00800 delete ACE_Object_Manager::instance_; 00801 ACE_Object_Manager::instance_ = 0; 00802 } 00803 // else if this destructor is not called by the main thread, then do 00804 // not delete the ACE_Object_Manager. That causes problems, on 00805 // WIN32 at least. 00806 }
Save the main thread ID, so that destruction can be suppressed.
Definition at line 782 of file Object_Manager.cpp.
Referenced by ~ACE_Object_Manager_Manager().