summaryrefslogtreecommitdiff
path: root/ACE/ace
diff options
context:
space:
mode:
authoriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-08-02 20:29:52 +0000
committeriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-08-02 20:29:52 +0000
commit7e92676abdf4458a5a7b3b45daba47d26b0892a5 (patch)
treea4453b230f59c38c15e845592d2bd1083fc1d667 /ACE/ace
parent726cd567eda281d0975075f8c15a9d01d7c9cbdb (diff)
downloadATCD-7e92676abdf4458a5a7b3b45daba47d26b0892a5.tar.gz
Thu Aug 2 20:24:22 UTC 2007 Iliyan Jeliazkov <iliyan@ociweb.com>
Diffstat (limited to 'ACE/ace')
-rw-r--r--ACE/ace/Service_Config.h44
1 files changed, 25 insertions, 19 deletions
diff --git a/ACE/ace/Service_Config.h b/ACE/ace/Service_Config.h
index 9ec6d76d7ea..5db4d8d0746 100644
--- a/ACE/ace/Service_Config.h
+++ b/ACE/ace/Service_Config.h
@@ -135,32 +135,38 @@ public:
#define ACE_Component_Config ACE_Service_Config
-/// A prototype for the partial specialization. This specialization
-/// allows us to have an ACE_TSS, which will _not_ perform a delete on
-/// (ACE_Service_Gestalt*) p up on thread exit, when TSS is cleaned
+/// This specialization enures ACE_TSS will _not_ perform a delete on
+/// (ACE_Service_Gestalt*) p upon thread exit, when TSS is cleaned
/// up. Note that the tss_ member will be destroyed with the
-/// ACE_Object_Manager's ACE_Service_Config singleton, so no leaks are
-/// introduced.
-/// We need this because the SC instance is really owned by the
-/// Object Manager and the TSS cleanup must not dispose of it
-/// prematurely. Naturally, things would be simpler, if we could
+/// ACE_Object_Manager's ACE_Service_Config singleton, so no leaks
+/// will be introduced.
+/// We need this non-ownership ACE_TSS because the SC instance is
+/// really owned by the Object Manager and only it must do the cleanup.
+///
+/// Naturally, things would be simpler, if we could
/// avoid using the TSS altogether but we need the ability to
/// temporarily designate a different SC instance as the "default."
/// So, the solution is a hybrid, or non-owner ACE_TSS. See bugzila
/// 2980 for a description of a test case where ACE_TSS::cleanup() is
/// called before ~ACE_Object_Manager.
-ACE_MT (
- // Since ACE_TSS<>::cleanup() is only defined in
- // multithreaded builds ...
- template<> inline void
- ACE_TSS<ACE_Service_Gestalt>::cleanup (void*ptr)
- {
- // Borland C++ 2007 *needs* the parameter
- // name, but it is not clear why ...
- ACE_UNUSED_ARG (ptr);
- }
-) // ACE_MT
+# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+// Since ACE_TSS<>::cleanup() is only defined in
+// multithreaded builds ...
+template<> inline void
+ACE_TSS<ACE_Service_Gestalt>::cleanup (void*ptr)
+{
+ // Borland C++ 2007 *needs* the parameter
+ // name, but it is not clear why ...
+ ACE_UNUSED_ARG (ptr);
+}
+# else
+template<> inline
+ACE_TSS<ACE_Service_Gestalt>::~ACE_TSS (void)
+{
+ // Without threads, the ACE_TSS cleanup is done by ~ACE_TSS()
+}
+# endif /* ACE_MT_SAFE */
/**