summaryrefslogtreecommitdiff
path: root/ace/Singleton.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-12-30 06:50:29 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-12-30 06:50:29 +0000
commita4a7690c336d4c8a16b3041c86d501ba38226e96 (patch)
tree9e9f93a98edd2591453f092d178ad29a1c5fb519 /ace/Singleton.cpp
parenta5c4d8047ab58df5c45092e18ae503ad40518f0e (diff)
downloadATCD-unlabeled-4.1.2.tar.gz
This commit was manufactured by cvs2svn to create branchunlabeled-4.1.2
'unlabeled-4.1.2'.
Diffstat (limited to 'ace/Singleton.cpp')
-rw-r--r--ace/Singleton.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/ace/Singleton.cpp b/ace/Singleton.cpp
deleted file mode 100644
index 5d6a6e8ea31..00000000000
--- a/ace/Singleton.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Singleton.cpp
-// $Id$
-
-#if !defined (ACE_SINGLETON_C)
-#define ACE_SINGLETON_C
-
-#define ACE_BUILD_DLL
-#include "ace/Singleton.h"
-#include "ace/Synch_T.h"
-
-#if !defined (__ACE_INLINE__)
-#include "ace/Singleton.i"
-#endif /* __ACE_INLINE__ */
-
-template <class TYPE, class LOCK> void
-ACE_Singleton<TYPE, LOCK>::dump (void) const
-{
- ACE_TRACE ("ACE_Singleton<TYPE, LOCK>::dump");
-
- ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
-#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES)
- ACE_DEBUG ((LM_DEBUG, "instance_ = %x", this->instance_));
- ace_singleton_lock_.dump ();
- ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
-#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */
-}
-
-template <class TYPE, class LOCK> TYPE *
-ACE_Singleton<TYPE, LOCK>::instance (void)
-{
- ACE_TRACE ("ACE_Singleton::instance");
-
-#if defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES)
- // Pointer to the Singleton instance. This works around a bug with
- // G++...
- static TYPE *instance_ = 0;
-
- // Lock the creation of the singleton. This works around a
- // "feature" of G++... ;-)
- static LOCK ace_singleton_lock_;
- // Perform the Double-Check pattern...
- if (instance_ == 0)
- {
- ACE_GUARD_RETURN (LOCK, ace_mon, ace_singleton_lock_, 0);
-
- if (instance_ == 0)
- ACE_NEW_RETURN (instance_, TYPE, 0);
- }
-
- return instance_;
-#else
-
- // Perform the Double-Check pattern...
- if (ACE_Singleton<TYPE, LOCK>::instance_ == 0)
- {
- ACE_GUARD_RETURN (LOCK, ace_mon, (ACE_Singleton<TYPE, LOCK>::ace_singleton_lock_), 0);
-
- if (ACE_Singleton<TYPE, LOCK>::instance_ == 0)
- ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0);
- }
-
- return ACE_Singleton<TYPE, LOCK>::instance_;
-
-#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */
-
-}
-
-#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES)
-// Pointer to the Singleton instance.
-template <class TYPE, class LOCK> TYPE *
-ACE_Singleton<TYPE, LOCK>::instance_ = 0;
-
-// Lock the creation of the singleton.
-template <class TYPE, class LOCK> LOCK
-ACE_Singleton<TYPE, LOCK>::ace_singleton_lock_;
-#endif /* !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) */
-
-#endif /* ACE_SINGLETON_C */