summaryrefslogtreecommitdiff
path: root/TAO/tao/TAO_Singleton_Manager.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2004-09-09 23:19:20 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2004-09-09 23:19:20 +0000
commita30d62642a36751609ef4b331b9ffccd997870f9 (patch)
tree2bfd43cca34b21d5ccdd8414d26480ce37f13d44 /TAO/tao/TAO_Singleton_Manager.cpp
parent1940c80f01ef5431a4e66c2faed46e14a2c0f31f (diff)
downloadATCD-a30d62642a36751609ef4b331b9ffccd997870f9.tar.gz
ChangeLogTag:Thu Sep 9 16:16:48 2004 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/TAO_Singleton_Manager.cpp')
-rw-r--r--TAO/tao/TAO_Singleton_Manager.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/TAO/tao/TAO_Singleton_Manager.cpp b/TAO/tao/TAO_Singleton_Manager.cpp
index 7c1621cf566..872dea0e5fc 100644
--- a/TAO/tao/TAO_Singleton_Manager.cpp
+++ b/TAO/tao/TAO_Singleton_Manager.cpp
@@ -51,6 +51,9 @@ TAO_Singleton_Manager::TAO_Singleton_Manager (void)
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
, internal_lock_ (new TAO_SYNCH_RECURSIVE_MUTEX)
# endif /* ACE_MT_SAFE */
+#if defined (ACE_HAS_EXCEPTIONS)
+ , old_unexpected_ (0)
+#endif /* ACE_HAS_EXCEPTIONS */
{
// Be sure that no further instances are created via instance ().
if (instance_ == 0)
@@ -248,6 +251,19 @@ TAO_Singleton_Manager::fini (void)
this->internal_lock_ = 0;
#endif /* ACE_MT_SAFE */
+#if defined (ACE_HAS_EXCEPTIONS)
+ // Restore the old unexpected exception handler since TAO will no
+ // longer be handling exceptions. Allow the application to once
+ // again handle unexpected exceptions.
+# if (!defined (_MSC_VER) \
+ && defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) \
+ && (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0)) || defined (ghs)
+ (void) std::set_unexpected (this->old_unexpected_);
+# else
+ (void) set_unexpected (this->old_unexpected_);
+# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */
+#endif /* ACE_HAS_EXCEPTIONS */
+
// Indicate that this TAO_Singleton_Manager instance has been shut down.
this->object_manager_state_ = OBJ_MAN_SHUT_DOWN;
@@ -284,6 +300,26 @@ TAO_Singleton_Manager::shutting_down (void)
: 1;
}
+#if defined (ACE_HAS_EXCEPTIONS)
+void
+TAO_Singleton_Manager::_set_unexpected (TAO_unexpected_handler u)
+{
+ // This must be done after the system TypeCodes and Exceptions have
+ // been initialized. An unexpected exception will cause TAO's
+ // unexpected exception handler to be called. That handler
+ // transforms all unexpected exceptions to CORBA::UNKNOWN, which of
+ // course requires the TypeCode constants and system exceptions to
+ // have been initialized.
+# if (!defined (_MSC_VER) \
+ && defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) \
+ && (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0)) || defined (ghs)
+ this->old_unexpected_ = std::set_unexpected (u);
+# else
+ this->old_unexpected_ = set_unexpected (u);
+# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */
+}
+#endif /* ACE_HAS_EXCEPTIONS */
+
int
TAO_Singleton_Manager::at_exit_i (void *object,
ACE_CLEANUP_FUNC cleanup_hook,