summaryrefslogtreecommitdiff
path: root/ace/Singleton.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
commit437eea6fa08e931864f89be91d14a816f69075c7 (patch)
treeb8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /ace/Singleton.cpp
parentea0d28240863caf437a18071bfd03e7b146c5ade (diff)
downloadATCD-unlabeled-4.2.2.tar.gz
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.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 */