diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-01-15 07:57:27 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-01-15 07:57:27 +0000 |
commit | 7bcf346410d13a031025bcdeb87c4bed4bc4dd5a (patch) | |
tree | 9f76a93c1df2e2eb8387f634b70d1df6aec721a6 /ACE/ace/Object_Manager.cpp | |
parent | 903a1678de138d6dbb4711be1decb816ab86bb88 (diff) | |
download | ATCD-7bcf346410d13a031025bcdeb87c4bed4bc4dd5a.tar.gz |
Thu Jan 15 07:56:02 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Cleanup.{h,cpp}:
Added a const char* name member to ACE_Cleanup_Info_Node, this
can be passed in when registering an at_exit hook. This string can
then be used during debugging to detect problems at shutdown. It
can happen that the cleanup hook is from a dll that already is
unloaded and then we get a crash with no information, the string
at least can tell us which hook we are calling. This fixes bugzilla
3544.
* ace/Log_Msg.cpp:
* ace/Object_Manager.{h,cpp,inl}:
* ace/Object_Manager_Base.{h,cpp}:
* ace/OS_NS_stdlib.{h,inl}:
* ace/Process_Manager.cpp:
* ace/Singleton.cpp:
* ace/Token_Invariants.cpp:
* ace/Token_Manager.cpp:
Pass in the typeid of the object when registering an at_exit hook
* ace/Thread.cpp:
Moved local variable inside the loop
Diffstat (limited to 'ACE/ace/Object_Manager.cpp')
-rw-r--r-- | ACE/ace/Object_Manager.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/ACE/ace/Object_Manager.cpp b/ACE/ace/Object_Manager.cpp index f6986c58c6e..f158cdcffdd 100644 --- a/ACE/ace/Object_Manager.cpp +++ b/ACE/ace/Object_Manager.cpp @@ -444,7 +444,8 @@ ACE_Object_Manager::instance (void) int ACE_Object_Manager::at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param) + void *param, + const char* name) { ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *instance_->internal_lock_, -1)); @@ -462,7 +463,7 @@ ACE_Object_Manager::at_exit_i (void *object, return -1; } - return exit_info_.at_exit_i (object, cleanup_hook, param); + return exit_info_.at_exit_i (object, cleanup_hook, param, name); } int @@ -547,16 +548,16 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock) if (lock == 0) { ACE_Cleanup_Adapter<ACE_Thread_Mutex> *lock_adapter = 0; - ACE_NEW_RETURN (lock_adapter, - 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_ - // again; that's why it is a recursive lock. - ACE_Object_Manager::at_exit (lock_adapter); + ACE_NEW_RETURN (lock_adapter, + 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_ + // again; that's why it is a recursive lock. + ACE_Object_Manager::at_exit (lock_adapter, 0, typeid (*lock_adapter).name ()); } } } |