Object_Manager_Base.cpp

Go to the documentation of this file.
00001 // Object_Manager_Base.cpp,v 1.10 2005/11/22 09:23:55 ossama Exp
00002 
00003 #include "ace/Object_Manager_Base.h"
00004 
00005 ACE_RCSID(ace, Object_Manager_Base, "Object_Manager_Base.cpp,v 1.10 2005/11/22 09:23:55 ossama Exp")
00006 
00007 #include "ace/OS_Memory.h"
00008 #include "ace/OS_NS_Thread.h"
00009 #include "ace/OS_NS_sys_socket.h"
00010 #include "ace/OS_NS_signal.h"
00011 #include "ace/OS_NS_stdio.h"
00012 
00013 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00014 
00015 #if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
00016 int ACE_SEH_Default_Exception_Selector (void *)
00017 {
00018 #if 0
00019   ACE_DEBUG ((LM_DEBUG,
00020               ACE_LIB_TEXT ("(%t) Win32 structured exception exiting thread\n")));
00021 #endif /* 0 */
00022   // this is only windows and only used here,
00023   // defined in ace/config-win32-common.h.
00024   return (DWORD) ACE_SEH_DEFAULT_EXCEPTION_HANDLING_ACTION;
00025 }
00026 
00027 int ACE_SEH_Default_Exception_Handler (void *)
00028 {
00029   return 0;
00030 }
00031 #endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
00032 
00033 # define ACE_OS_PREALLOCATE_OBJECT(TYPE, ID)\
00034     {\
00035       TYPE *obj_p = 0;\
00036       ACE_NEW_RETURN (obj_p, TYPE, -1);\
00037       preallocated_object[ID] = (void *) obj_p;\
00038     }
00039 # define ACE_OS_DELETE_PREALLOCATED_OBJECT(TYPE, ID)\
00040     delete (TYPE *) preallocated_object[ID];\
00041     preallocated_object[ID] = 0;
00042 
00043 ACE_Object_Manager_Base::ACE_Object_Manager_Base (void)
00044   : object_manager_state_ (OBJ_MAN_UNINITIALIZED)
00045   , dynamically_allocated_ (0)
00046   , next_ (0)
00047 {
00048 }
00049 
00050 ACE_Object_Manager_Base::~ACE_Object_Manager_Base (void)
00051 {
00052 #if defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER)
00053   // Clear the flag so that fini () doesn't delete again.
00054   dynamically_allocated_ = 0;
00055 #endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */
00056 }
00057 
00058 int
00059 ACE_Object_Manager_Base::starting_up_i ()
00060 {
00061   return object_manager_state_ < OBJ_MAN_INITIALIZED;
00062 }
00063 
00064 int
00065 ACE_Object_Manager_Base::shutting_down_i ()
00066 {
00067   return object_manager_state_ > OBJ_MAN_INITIALIZED;
00068 }
00069 
00070 /*****************************************************************************/
00071 
00072 extern "C"
00073 void
00074 ACE_OS_Object_Manager_Internal_Exit_Hook (void)
00075 {
00076   if (ACE_OS_Object_Manager::instance_)
00077     ACE_OS_Object_Manager::instance ()->fini ();
00078 }
00079 
00080 ACE_OS_Object_Manager *ACE_OS_Object_Manager::instance_ = 0;
00081 
00082 void *ACE_OS_Object_Manager::preallocated_object[
00083   ACE_OS_Object_Manager::ACE_OS_PREALLOCATED_OBJECTS] = { 0 };
00084 
00085 ACE_OS_Object_Manager::ACE_OS_Object_Manager (void)
00086   // default_mask_ isn't initialized, because it's defined by <init>.
00087   : thread_hook_ (0)
00088   , exit_info_ ()
00089 #if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
00090   , seh_except_selector_ (ACE_SEH_Default_Exception_Selector)
00091   , seh_except_handler_ (ACE_SEH_Default_Exception_Handler)
00092 #endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
00093 {
00094   // If instance_ was not 0, then another ACE_OS_Object_Manager has
00095   // already been instantiated (it is likely to be one initialized by
00096   // way of library/DLL loading).  Let this one go through
00097   // construction in case there really is a good reason for it (like,
00098   // ACE is a static/archive library, and this one is the non-static
00099   // instance (with ACE_HAS_NONSTATIC_OBJECT_MANAGER, or the user has
00100   // a good reason for creating a separate one) but the original one
00101   // will be the one retrieved from calls to
00102   // ACE_Object_Manager::instance().
00103 
00104   // Be sure that no further instances are created via instance ().
00105   if (instance_ == 0)
00106     instance_ = this;
00107 
00108   init ();
00109 }
00110 
00111 ACE_OS_Object_Manager::~ACE_OS_Object_Manager (void)
00112 {
00113   dynamically_allocated_ = 0;   // Don't delete this again in fini()
00114   fini ();
00115 }
00116 
00117 sigset_t *
00118 ACE_OS_Object_Manager::default_mask (void)
00119 {
00120   return ACE_OS_Object_Manager::instance ()->default_mask_;
00121 }
00122 
00123 ACE_Thread_Hook *
00124 ACE_OS_Object_Manager::thread_hook (void)
00125 {
00126   return ACE_OS_Object_Manager::instance ()->thread_hook_;
00127 }
00128 
00129 #if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
00130 ACE_SEH_EXCEPT_HANDLER
00131 ACE_OS_Object_Manager::seh_except_selector (void)
00132 {
00133   return ACE_OS_Object_Manager::instance ()->seh_except_selector_;
00134 }
00135 
00136 ACE_SEH_EXCEPT_HANDLER
00137 ACE_OS_Object_Manager::seh_except_selector (ACE_SEH_EXCEPT_HANDLER n)
00138 {
00139   ACE_OS_Object_Manager *instance =
00140     ACE_OS_Object_Manager::instance ();
00141 
00142   ACE_SEH_EXCEPT_HANDLER retv = instance->seh_except_selector_;
00143   instance->seh_except_selector_ = n;
00144   return retv;
00145 }
00146 
00147 ACE_SEH_EXCEPT_HANDLER
00148 ACE_OS_Object_Manager::seh_except_handler (void)
00149 {
00150   return ACE_OS_Object_Manager::instance ()->seh_except_handler_;
00151 }
00152 
00153 ACE_SEH_EXCEPT_HANDLER
00154 ACE_OS_Object_Manager::seh_except_handler (ACE_SEH_EXCEPT_HANDLER n)
00155 {
00156   ACE_OS_Object_Manager *instance =
00157     ACE_OS_Object_Manager::instance ();
00158 
00159   ACE_SEH_EXCEPT_HANDLER retv = instance->seh_except_handler_;
00160   instance->seh_except_handler_ = n;
00161   return retv;
00162 }
00163 #endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
00164 
00165 ACE_Thread_Hook *
00166 ACE_OS_Object_Manager::thread_hook (ACE_Thread_Hook *new_thread_hook)
00167 {
00168   ACE_OS_Object_Manager *os_om = ACE_OS_Object_Manager::instance ();
00169   ACE_Thread_Hook *old_hook = os_om->thread_hook_;
00170   os_om->thread_hook_ = new_thread_hook;
00171   return old_hook;
00172 }
00173 
00174 ACE_OS_Object_Manager *
00175 ACE_OS_Object_Manager::instance (void)
00176 {
00177   // This function should be called during construction of static
00178   // instances, or before any other threads have been created in the
00179   // process.  So, it's not thread safe.
00180 
00181   if (instance_ == 0)
00182     {
00183       ACE_OS_Object_Manager *instance_pointer;
00184 
00185       ACE_NEW_RETURN (instance_pointer,
00186                       ACE_OS_Object_Manager,
00187                       0);
00188       // I (coryan) removed it, using asserts in the OS layer
00189       // brings down the Log msg stuff
00190       // ACE_ASSERT (instance_pointer == instance_);
00191 
00192       instance_pointer->dynamically_allocated_ = 1;
00193 
00194     }
00195 
00196   return instance_;
00197 }
00198 
00199 int
00200 ACE_OS_Object_Manager::init (void)
00201 {
00202   if (starting_up_i ())
00203     {
00204       // First, indicate that this ACE_OS_Object_Manager instance is being
00205       // initialized.
00206       object_manager_state_ = OBJ_MAN_INITIALIZING;
00207 
00208       if (this == instance_)
00209         {
00210 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
00211 #   if defined (ACE_HAS_WINCE_BROKEN_ERRNO)
00212           ACE_CE_Errno::init ();
00213 #   endif /* ACE_HAS_WINCE_BROKEN_ERRNO */
00214           ACE_OS_PREALLOCATE_OBJECT (ACE_thread_mutex_t, ACE_OS_MONITOR_LOCK)
00215           if (ACE_OS::thread_mutex_init
00216               // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00217               (reinterpret_cast <ACE_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_OS_MONITOR_LOCK])) != 0)
00218             ACE_OS_Object_Manager::print_error_message (
00219               __LINE__, ACE_LIB_TEXT ("ACE_OS_MONITOR_LOCK"));
00220           ACE_OS_PREALLOCATE_OBJECT (ACE_recursive_thread_mutex_t,
00221                                      ACE_TSS_CLEANUP_LOCK)
00222           if (ACE_OS::recursive_mutex_init
00223               // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00224               (reinterpret_cast <ACE_recursive_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_TSS_CLEANUP_LOCK])) != 0)
00225             ACE_OS_Object_Manager::print_error_message (
00226               __LINE__, ACE_LIB_TEXT ("ACE_TSS_CLEANUP_LOCK"));
00227           ACE_OS_PREALLOCATE_OBJECT (ACE_thread_mutex_t,
00228                                      ACE_LOG_MSG_INSTANCE_LOCK)
00229           if (ACE_OS::thread_mutex_init
00230               // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00231               (reinterpret_cast <ACE_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_LOG_MSG_INSTANCE_LOCK])) != 0)
00232             ACE_OS_Object_Manager::print_error_message (
00233               __LINE__, ACE_LIB_TEXT ("ACE_LOG_MSG_INSTANCE_LOCK"));
00234 #   if defined (ACE_HAS_TSS_EMULATION)
00235           ACE_OS_PREALLOCATE_OBJECT (ACE_recursive_thread_mutex_t,
00236                                      ACE_TSS_KEY_LOCK)
00237           if (ACE_OS::recursive_mutex_init
00238               // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00239               (reinterpret_cast <ACE_recursive_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_TSS_KEY_LOCK])) != 0)
00240             ACE_OS_Object_Manager::print_error_message (
00241               __LINE__, ACE_LIB_TEXT ("ACE_TSS_KEY_LOCK"));
00242 #     if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)
00243           ACE_OS_PREALLOCATE_OBJECT (ACE_recursive_thread_mutex_t,
00244                                      ACE_TSS_BASE_LOCK)
00245           if (ACE_OS::recursive_mutex_init
00246               // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00247               (reinterpret_cast <ACE_recursive_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_TSS_BASE_LOCK])) != 0)
00248             ACE_OS_Object_Manager::print_error_message (
00249               __LINE__, ACE_LIB_TEXT ("ACE_TSS_BASE_LOCK"));
00250 #     endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */
00251 #   endif /* ACE_HAS_TSS_EMULATION */
00252 # endif /* ACE_MT_SAFE */
00253 
00254           // Open Winsock (no-op on other platforms).
00255           ACE_OS::socket_init (ACE_WSOCK_VERSION);
00256 
00257           // Register the exit hook, for use by ACE_OS::exit ().
00258           ACE_OS::set_exit_hook (&ACE_OS_Object_Manager_Internal_Exit_Hook);
00259         }
00260 
00261       ACE_NEW_RETURN (default_mask_, sigset_t, -1);
00262       ACE_OS::sigfillset (default_mask_);
00263 
00264       // Finally, indicate that the ACE_OS_Object_Manager instance has
00265       // been initialized.
00266       object_manager_state_ = OBJ_MAN_INITIALIZED;
00267 
00268 # if defined (ACE_WIN32)
00269       ACE_OS::win32_versioninfo_.dwOSVersionInfoSize =
00270         sizeof (OSVERSIONINFO);
00271       ::GetVersionEx (&ACE_OS::win32_versioninfo_);
00272 # endif /* ACE_WIN32 */
00273       return 0;
00274     } else {
00275       // Had already initialized.
00276       return 1;
00277     }
00278 }
00279 
00280 // Clean up an ACE_OS_Object_Manager.  There can be instances of this object
00281 // other than The Instance.  This can happen if a user creates one for some
00282 // reason.  All objects clean up their per-object information and managed
00283 // objects, but only The Instance cleans up the static preallocated objects.
00284 int
00285 ACE_OS_Object_Manager::fini (void)
00286 {
00287   if (instance_ == 0  ||  shutting_down_i ())
00288     // Too late.  Or, maybe too early.  Either fini () has already
00289     // been called, or init () was never called.
00290     return object_manager_state_ == OBJ_MAN_SHUT_DOWN  ?  1  :  -1;
00291 
00292   // No mutex here.  Only the main thread should destroy the singleton
00293   // ACE_OS_Object_Manager instance.
00294 
00295   // Indicate that the ACE_OS_Object_Manager instance is being shut
00296   // down.  This object manager should be the last one to be shut
00297   // down.
00298   object_manager_state_ = OBJ_MAN_SHUTTING_DOWN;
00299 
00300   // If another Object_Manager has registered for termination, do it.
00301   if (next_)
00302     {
00303       next_->fini ();
00304       next_ = 0;  // Protect against recursive calls.
00305     }
00306 
00307   // Call all registered cleanup hooks, in reverse order of
00308   // registration.
00309   exit_info_.call_hooks ();
00310 
00311   // Only clean up preallocated objects when the singleton Instance is being
00312   // destroyed.
00313   if (this == instance_)
00314     {
00315       // Close down Winsock (no-op on other platforms).
00316       ACE_OS::socket_fini ();
00317 
00318 #if ! defined (ACE_HAS_STATIC_PREALLOCATION)
00319       // Cleanup the dynamically preallocated objects.
00320 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
00321 #   if !defined(ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK)
00322       if (ACE_OS::thread_mutex_destroy
00323           // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00324           (reinterpret_cast <ACE_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_OS_MONITOR_LOCK])) != 0)
00325         ACE_OS_Object_Manager::print_error_message (
00326           __LINE__, ACE_LIB_TEXT ("ACE_OS_MONITOR_LOCK"));
00327 #   endif /* ! ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK */
00328       ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_thread_mutex_t,
00329                                          ACE_OS_MONITOR_LOCK)
00330 #   if !defined(ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK)
00331       if (ACE_OS::recursive_mutex_destroy
00332           // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00333           (reinterpret_cast <ACE_recursive_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_TSS_CLEANUP_LOCK])) != 0)
00334         ACE_OS_Object_Manager::print_error_message (
00335           __LINE__, ACE_LIB_TEXT ("ACE_TSS_CLEANUP_LOCK"));
00336 #   endif /* ! ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK */
00337       ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_recursive_thread_mutex_t,
00338                                          ACE_TSS_CLEANUP_LOCK)
00339 #   if !defined(ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK)
00340       if (ACE_OS::thread_mutex_destroy
00341           // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00342           (reinterpret_cast <ACE_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object [ACE_LOG_MSG_INSTANCE_LOCK])) != 0)
00343         ACE_OS_Object_Manager::print_error_message (
00344           __LINE__, ACE_LIB_TEXT ("ACE_LOG_MSG_INSTANCE_LOCK "));
00345 #   endif /* ! ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK */
00346       ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_thread_mutex_t,
00347                                          ACE_LOG_MSG_INSTANCE_LOCK)
00348 #   if defined (ACE_HAS_TSS_EMULATION)
00349 #     if !defined(ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK)
00350         if (ACE_OS::recursive_mutex_destroy
00351             // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00352             (reinterpret_cast <ACE_recursive_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_TSS_KEY_LOCK])) != 0)
00353           ACE_OS_Object_Manager::print_error_message (
00354             __LINE__, ACE_LIB_TEXT ("ACE_TSS_KEY_LOCK"));
00355 #     endif /* ! ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK */
00356       ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_recursive_thread_mutex_t,
00357                                          ACE_TSS_KEY_LOCK)
00358 #     if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)
00359 #       if !defined(ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK)
00360           if (ACE_OS::recursive_mutex_destroy
00361               // This line must not be broken to avoid tickling a bug with SunC++'s preprocessor.
00362               (reinterpret_cast <ACE_recursive_thread_mutex_t *> (ACE_OS_Object_Manager::preallocated_object[ACE_TSS_BASE_LOCK])) != 0)
00363             ACE_OS_Object_Manager::print_error_message (
00364               __LINE__, ACE_LIB_TEXT ("ACE_TSS_BASE_LOCK"));
00365 #       endif /* ! ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK */
00366       ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_recursive_thread_mutex_t,
00367                                          ACE_TSS_BASE_LOCK)
00368 #     endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */
00369 #   endif /* ACE_HAS_TSS_EMULATION */
00370 #   if defined (ACE_HAS_WINCE_BROKEN_ERRNO)
00371           ACE_CE_Errno::fini ();
00372 #   endif /* ACE_HAS_WINCE_BROKEN_ERRNO */
00373 # endif /* ACE_MT_SAFE */
00374 #endif /* ! ACE_HAS_STATIC_PREALLOCATION */
00375     }
00376 
00377   delete default_mask_;
00378   default_mask_ = 0;
00379 
00380   // Indicate that this ACE_OS_Object_Manager instance has been shut down.
00381   object_manager_state_ = OBJ_MAN_SHUT_DOWN;
00382 
00383   if (dynamically_allocated_)
00384     {
00385       delete this;
00386     }
00387 
00388   if (this == instance_)
00389     instance_ = 0;
00390 
00391   return 0;
00392 }
00393 
00394 int ace_exit_hook_marker = 0;
00395 
00396 int
00397 ACE_OS_Object_Manager::at_exit (ACE_EXIT_HOOK func)
00398 {
00399   return exit_info_.at_exit_i (&ace_exit_hook_marker,
00400                                reinterpret_cast <ACE_CLEANUP_FUNC> (func),
00401                                0);
00402 }
00403 
00404 void
00405 ACE_OS_Object_Manager::print_error_message (unsigned int line_number,
00406                                             const ACE_TCHAR *message)
00407 {
00408   // To avoid duplication of these const strings in OS.o.
00409 #if !defined (ACE_HAS_WINCE)
00410   fprintf (stderr, "ace/OS.cpp, line %u: %s ",
00411            line_number,
00412            ACE_TEXT_ALWAYS_CHAR (message));
00413   perror ("failed");
00414 #else
00415   // @@ Need to use the following information.
00416   ACE_UNUSED_ARG (line_number);
00417   ACE_UNUSED_ARG (message);
00418 
00419   ACE_TCHAR *lpMsgBuf = 0;
00420   ::FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
00421                    FORMAT_MESSAGE_FROM_SYSTEM,
00422                    0,
00423                    ::GetLastError (),
00424                    MAKELANGID (LANG_NEUTRAL,
00425                                SUBLANG_DEFAULT),
00426                    // Default language
00427                    (ACE_TCHAR *) &lpMsgBuf,
00428                    0,
00429                    0);
00430   ::MessageBox (NULL,
00431                 lpMsgBuf,
00432                 ACE_LIB_TEXT ("ACE_OS error"),
00433                 MB_OK);
00434 #endif
00435 }
00436 
00437 int
00438 ACE_OS_Object_Manager::starting_up (void)
00439 {
00440   return ACE_OS_Object_Manager::instance_
00441     ? instance_->starting_up_i ()
00442     : 1;
00443 }
00444 
00445 int
00446 ACE_OS_Object_Manager::shutting_down (void)
00447 {
00448   return ACE_OS_Object_Manager::instance_
00449     ? instance_->shutting_down_i ()
00450     : 1;
00451 }
00452 
00453 /*****************************************************************************/
00454 
00455 #if !defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER)
00456 /**
00457  * @class ACE_OS_Object_Manager_Manager
00458  *
00459  * @brief Ensure that the ACE_OS_Object_Manager gets initialized at
00460  * program startup, and destroyed at program termination.
00461  *
00462  * Without ACE_HAS_NONSTATIC_OBJECT_MANAGER, a static instance of this
00463  * class is created.  Therefore, it gets created before main ()
00464  * is called.  And it gets destroyed after main () returns.
00465  */
00466 class ACE_OS_Object_Manager_Manager
00467 {
00468 public:
00469   /// Constructor.
00470   ACE_OS_Object_Manager_Manager (void);
00471 
00472   /// Destructor.
00473   ~ACE_OS_Object_Manager_Manager (void);
00474 
00475 private:
00476   /// Save the main thread ID, so that destruction can be suppressed.
00477   ACE_thread_t saved_main_thread_id_;
00478 };
00479 
00480 ACE_OS_Object_Manager_Manager::ACE_OS_Object_Manager_Manager (void)
00481   : saved_main_thread_id_ (ACE_OS::thr_self ())
00482 {
00483   // Ensure that the Object_Manager gets initialized before any
00484   // application threads have been spawned.  Because this will be called
00485   // during construction of static objects, that should always be the
00486   // case.
00487   (void) ACE_OS_Object_Manager::instance ();
00488 }
00489 
00490 ACE_OS_Object_Manager_Manager::~ACE_OS_Object_Manager_Manager (void)
00491 {
00492   if (ACE_OS::thr_equal (ACE_OS::thr_self (),
00493                          saved_main_thread_id_))
00494     {
00495       delete ACE_OS_Object_Manager::instance_;
00496       ACE_OS_Object_Manager::instance_ = 0;
00497     }
00498   // else if this destructor is not called by the main thread, then do
00499   // not delete the ACE_OS_Object_Manager.  That causes problems, on
00500   // WIN32 at least.
00501 }
00502 
00503 static ACE_OS_Object_Manager_Manager ACE_OS_Object_Manager_Manager_instance;
00504 #endif /* ! ACE_HAS_NONSTATIC_OBJECT_MANAGER */
00505 
00506 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:41:57 2006 for ACE by doxygen 1.3.6