summaryrefslogtreecommitdiff
path: root/ace/Log_Msg.cpp
diff options
context:
space:
mode:
authordoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-10-02 01:11:43 +0000
committerdoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-10-02 01:11:43 +0000
commitccdf0b5ce836aa697e01fad29488ba41ac50fcc7 (patch)
treec247700548c4ad818decccfa03691a5d56c5ba39 /ace/Log_Msg.cpp
parentd0136cffdd5b60aeb9978cf9f80f2f64cab6bf35 (diff)
downloadATCD-ccdf0b5ce836aa697e01fad29488ba41ac50fcc7.tar.gz
ChangeLogTag: Mon Oct 1 18:06:48 2001 Priyanka Gontla <pgontla@ece.uci.edu>
Diffstat (limited to 'ace/Log_Msg.cpp')
-rw-r--r--ace/Log_Msg.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index ba132d90191..8b2ba82dfc5 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -249,7 +249,14 @@ ACE_Log_Msg::instance (void)
ACE_reinterpret_cast (ACE_thread_mutex_t *,
ACE_OS_Object_Manager::preallocated_object
[ACE_OS_Object_Manager::ACE_LOG_MSG_INSTANCE_LOCK]);
- ACE_OS::thread_mutex_lock (lock);
+
+ if (1 == ACE_OS_Object_Manager::starting_up())
+ //This function is called before ACE_OS_Object_Manager is
+ //initialized. So the lock might not be valid. Assume it's
+ //single threaded and so don't need the lock.
+ ;
+ else
+ ACE_OS::thread_mutex_lock (lock);
if (key_created_ == 0)
{
@@ -261,6 +268,12 @@ ACE_Log_Msg::instance (void)
if (ACE_Thread::keycreate (&log_msg_tss_key_,
&ACE_TSS_cleanup) != 0)
{
+ if (1 == ACE_OS_Object_Manager::starting_up())
+ //This function is called before ACE_OS_Object_Manager is
+ //initialized. So the lock might not be valid. Assume it's
+ //single threaded and so don't need the lock.
+ ;
+ else
ACE_OS::thread_mutex_unlock (lock);
return 0; // Major problems, this should *never* happen!
}
@@ -269,7 +282,13 @@ ACE_Log_Msg::instance (void)
key_created_ = 1;
}
- ACE_OS::thread_mutex_unlock (lock);
+ if (1 == ACE_OS_Object_Manager::starting_up())
+ //This function is called before ACE_OS_Object_Manager is
+ //initialized. So the lock might not be valid. Assume it's
+ //single threaded and so don't need the lock.
+ ;
+ else
+ ACE_OS::thread_mutex_unlock (lock);
}
ACE_Log_Msg *tss_log_msg = 0;