summaryrefslogtreecommitdiff
path: root/ace/Singleton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Singleton.cpp')
-rw-r--r--ace/Singleton.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/ace/Singleton.cpp b/ace/Singleton.cpp
index 28b9d23a5de..58e3e56a29b 100644
--- a/ace/Singleton.cpp
+++ b/ace/Singleton.cpp
@@ -67,12 +67,12 @@ ACE_Singleton<TYPE, ACE_LOCK>::instance (void)
}
else
{
- // Use the Object_Manager's preallocated lock.
- ACE_LOCK *lock =
- ACE_Object_Manager::get_singleton_lock ((ACE_LOCK *) 0);
-#if 0 // ???? HACK! Don't guard until singleton lock issue is resolved!
+ static ACE_LOCK *lock = 0;
+ // Obtain the lock from the ACE_Object_Manager.
+ ACE_Object_Manager::get_singleton_lock (lock);
+ if (lock == 0) return 0; // Failed to allocate the lock!
+
ACE_GUARD_RETURN (ACE_LOCK, ace_mon, *lock, 0);
-#endif // 0
if (singleton == 0)
{
@@ -157,12 +157,12 @@ ACE_TSS_Singleton<TYPE, ACE_LOCK>::instance (void)
}
else
{
- // Use the Object_Manager's preallocated lock.
- ACE_LOCK *lock =
- ACE_Object_Manager::get_singleton_lock ((ACE_LOCK *) 0);
-#if 0 // ???? HACK! Don't guard until singleton lock issue is resolved!
+ static ACE_LOCK *lock = 0;
+ // Obtain the lock from the ACE_Object_Manager.
+ ACE_Object_Manager::get_singleton_lock (lock);
+ if (lock == 0) return 0; // Failed to allocate the lock.
+
ACE_GUARD_RETURN (ACE_LOCK, ace_mon, *lock, 0);
-#endif // 0
if (singleton == 0)
{