diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-06 21:12:20 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-06 21:12:20 +0000 |
commit | 58565c318d037e3df06ad5467fd8f6b8fc50420d (patch) | |
tree | d05198cdd09f731efbc67b0d0752c786163b9dc8 | |
parent | e9bbb8fa95def20fee26be9d79bc8ab54dad2d7d (diff) | |
download | ATCD-58565c318d037e3df06ad5467fd8f6b8fc50420d.tar.gz |
ChangeLogTag: Tue Jul 06 15:56:19 1999 David L. Levine <levine@cs.wustl.edu>
-rw-r--r-- | ace/Object_Manager.cpp | 12 | ||||
-rw-r--r-- | ace/Object_Manager.h | 6 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index 0d7f1b04e85..70c0d7fee03 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -252,7 +252,7 @@ ACE_Object_Manager::init (void) return 0; } else { // Had already initialized. - return -1; + return 1; } } @@ -423,7 +423,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock) *ACE_Object_Manager::instance ()-> internal_lock_, -1)); - + if (lock == 0) { ACE_Cleanup_Adapter<ACE_Thread_Mutex> *lock_adapter; @@ -431,7 +431,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock) ACE_Cleanup_Adapter<ACE_Thread_Mutex>, -1); lock = &lock_adapter->object (); - + // Register the lock for destruction at program // termination. This call will cause us to grab the // ACE_Object_Manager::instance ()->internal_lock_ @@ -457,7 +457,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Mutex *&lock) // instance has been destroyed, so the internal lock is not // available. Either way, we can not use double-checked // locking. So, we'll leak the lock. - + ACE_NEW_RETURN (lock, ACE_Mutex, -1); @@ -541,7 +541,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_RW_Thread_Mutex *&lock) // instance has been destroyed, so the internal lock is not // available. Either way, we can not use double-checked // locking. So, we'll leak the lock. - + ACE_NEW_RETURN (lock, ACE_RW_Thread_Mutex, -1); @@ -593,7 +593,7 @@ ACE_Object_Manager::fini (void) if (shutting_down_i ()) // Too late. Or, maybe too early. Either fini () has already // been called, or init () was never called. - return -1; + return object_manager_state_ == OBJ_MAN_SHUT_DOWN ? 1 : -1; // No mutex here. Only the main thread should destroy the singleton // ACE_Object_Manager instance. diff --git a/ace/Object_Manager.h b/ace/Object_Manager.h index 96bd39daf79..cacc50b5faa 100644 --- a/ace/Object_Manager.h +++ b/ace/Object_Manager.h @@ -182,11 +182,13 @@ class ACE_Export ACE_Object_Manager : public ACE_Object_Manager_Base public: virtual int init (void); // Explicitly initialize (construct the singleton instance of) the - // ACE_Object_Manager. + // ACE_Object_Manager. Returns 0 on success, -1 on failure, and 1 + // if it had already been called. virtual int fini (void); // Explicitly destroy the singleton instance of the - // ACE_Object_Manager. + // ACE_Object_Manager. Returns 0 on success, -1 on failure, and 1 + // if it had already been called. static int starting_up (void); // Returns 1 before the ACE_Object_Manager has been constructed. |