summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-19 00:09:59 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-19 00:09:59 +0000
commit857264d452250621a8decf88122916960bb1d829 (patch)
treee44f4c9a071e5a196328958c55271bead8667aa9
parent0651f0a70511330a4b7451538bcd3b19804af0cb (diff)
downloadATCD-857264d452250621a8decf88122916960bb1d829.tar.gz
ChangeLogTag: Wed Aug 18 19:08:08 1999 David L. Levine <levine@cs.wustl.edu>
-rw-r--r--ChangeLog-99b31
-rw-r--r--ace/Log_Msg.cpp23
-rw-r--r--ace/OS.cpp58
-rw-r--r--ace/OS.h2
-rw-r--r--ace/Object_Manager.cpp4
-rw-r--r--ace/Object_Manager.h1
6 files changed, 76 insertions, 43 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b
index 68c481a2b63..bf53cc501d7 100644
--- a/ChangeLog-99b
+++ b/ChangeLog-99b
@@ -1,23 +1,30 @@
+Wed Aug 18 19:08:08 1999 David L. Levine <levine@cs.wustl.edu>
+
+ * ace/OS.{h,cpp},Object_Manager.{h,cpp},Log_Msg.cpp:
+ moved ACE_LOG_MSG_INSTANCE_LOCK from ACE_Object_Manager
+ to ACE_OS_Object_Manager, so that Log_Msg.cpp needn't
+ depend on Object_Manager for it.
+
Wed Aug 18 18:20:11 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
- * tests/SOCK_Send_Recv_Test.cpp:
- Fixed typo.
+ * tests/SOCK_Send_Recv_Test.cpp:
+ Fixed typo.
Wed Aug 18 17:58:06 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
- * THANKS:
- * ace/README:
- * ace/config-irix6.x-common.h:
- Added new macro (ACE_HAS_BROKEN_DGRAM_SENDV) to handle platforms
- where using sendmsg with exactly IOV_MAX elements in the iovec
- fails (normally the number of elements can be up to and
- including IOV_MAX). Thanks to Tobin Bergen-Hill
- <tbhill@dctd.saic.com> for tracking this down.
+ * THANKS:
+ * ace/README:
+ * ace/config-irix6.x-common.h:
+ Added new macro (ACE_HAS_BROKEN_DGRAM_SENDV) to handle platforms
+ where using sendmsg with exactly IOV_MAX elements in the iovec
+ fails (normally the number of elements can be up to and
+ including IOV_MAX). Thanks to Tobin Bergen-Hill
+ <tbhill@dctd.saic.com> for tracking this down.
Wed Aug 18 16:08:46 1999 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
- * tests/SOCK_Send_Recv_Test.cpp: Reformatted this test so
- that it conforms to ACE programming guidelines.
+ * tests/SOCK_Send_Recv_Test.cpp: Reformatted this test so
+ that it conforms to ACE programming guidelines.
Wed Aug 18 13:49:30 1999 David L. Levine <levine@cs.wustl.edu>
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index cf27baa1410..791a8e4f439 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -24,8 +24,10 @@
#include "ace/Thread_Manager.h"
#include "ace/Synch_T.h"
#include "ace/Signal.h"
-#include "ace/Object_Manager.h"
-#include "ace/Managed_Object.h"
+
+#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE == 0)
+# include "ace/Object_Manager.h"
+#endif /* ! ACE_MT_SAFE */
#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
# include "ace/streams.h"
@@ -193,11 +195,11 @@ ACE_Log_Msg::instance (void)
if (key_created_ == 0)
{
- ACE_Thread_Mutex *lock =
- ACE_Managed_Object<ACE_Thread_Mutex>::get_preallocated_object
- (ACE_Object_Manager::ACE_LOG_MSG_INSTANCE_LOCK);
-
- ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0);
+ ACE_thread_mutex_t *lock =
+ 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 (key_created_ == 0)
{
@@ -209,12 +211,15 @@ ACE_Log_Msg::instance (void)
if (ACE_Thread::keycreate (&log_msg_tss_key_,
&ACE_TSS_cleanup) != 0)
{
+ ACE_OS::thread_mutex_unlock (lock);
return 0; // Major problems, this should *never* happen!
}
}
key_created_ = 1;
}
+
+ ACE_OS::thread_mutex_unlock (lock);
}
ACE_Log_Msg *tss_log_msg = 0;
@@ -335,8 +340,8 @@ void
ACE_Log_Msg::close (void)
{
// Please note that this will be called by a statement that is
- // harded coded into the ACE_Object_Manager's shutdown sequence,
- // in its destructor.
+ // harded coded into the ACE_Object_Manager's shutdown sequence, in
+ // its destructor.
ACE_MT (ACE_Log_Msg_Manager::close ());
}
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 930494d66e8..077e59f41fa 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -5361,7 +5361,7 @@ ACE_OS::cond_destroy (ACE_cond_t *cv)
# endif /* ACE_HAS_THREADS */
}
-// @@ The following functions could be inlined if i could figure where
+// @@ The following functions could be inlined if i could figure where
// to put it among the #ifdefs!
int
ACE_OS::condattr_init (ACE_condattr_t &attributes,
@@ -6363,8 +6363,8 @@ ACE_OS_Object_Manager::init (void)
ACE_OS_Object_Manager::preallocated_object[
ACE_OS_MONITOR_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::init, ACE_OS_MONITOR_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::init, ACE_OS_MONITOR_LOCK")));
ACE_OS_PREALLOCATE_OBJECT (ACE_recursive_thread_mutex_t,
ACE_TSS_CLEANUP_LOCK)
if (ACE_OS::recursive_mutex_init (ACE_reinterpret_cast (
@@ -6372,8 +6372,19 @@ ACE_OS_Object_Manager::init (void)
ACE_OS_Object_Manager::preallocated_object[
ACE_TSS_CLEANUP_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::init, ACE_TSS_CLEANUP_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::init, ")
+ ASYS_TEXT ("ACE_TSS_CLEANUP_LOCK")));
+ ACE_OS_PREALLOCATE_OBJECT (ACE_thread_mutex_t,
+ ACE_LOG_MSG_INSTANCE_LOCK)
+ if (ACE_OS::thread_mutex_init (ACE_reinterpret_cast (
+ ACE_thread_mutex_t *,
+ ACE_OS_Object_Manager::preallocated_object[
+ ACE_LOG_MSG_INSTANCE_LOCK])) != 0)
+ ACE_ERROR ((LM_ERROR,
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::init, ")
+ ASYS_TEXT ("ACE_LOG_MSG_INSTANCE_LOCK")));
# if defined (ACE_HAS_TSS_EMULATION)
ACE_OS_PREALLOCATE_OBJECT (ACE_recursive_thread_mutex_t,
ACE_TSS_KEY_LOCK)
@@ -6382,8 +6393,8 @@ ACE_OS_Object_Manager::init (void)
ACE_OS_Object_Manager::preallocated_object[
ACE_TSS_KEY_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::init, ACE_TSS_KEY_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::init, ACE_TSS_KEY_LOCK")));
# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)
ACE_OS_PREALLOCATE_OBJECT (ACE_recursive_thread_mutex_t,
ACE_TSS_BASE_LOCK)
@@ -6392,8 +6403,8 @@ ACE_OS_Object_Manager::init (void)
ACE_OS_Object_Manager::preallocated_object[
ACE_TSS_BASE_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::init, ACE_TSS_BASE_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::init, ACE_TSS_BASE_LOCK")));
# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */
# endif /* ACE_HAS_TSS_EMULATION */
# endif /* ACE_MT_SAFE */
@@ -6459,8 +6470,8 @@ ACE_OS_Object_Manager::fini (void)
ACE_thread_mutex_t *,
ACE_OS_Object_Manager::preallocated_object[ACE_OS_MONITOR_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::fini, ACE_OS_MONITOR_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::fini, ACE_OS_MONITOR_LOCK")));
# endif /* ! __Lynx__ */
ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_thread_mutex_t,
ACE_OS_MONITOR_LOCK)
@@ -6470,11 +6481,24 @@ ACE_OS_Object_Manager::fini (void)
ACE_recursive_thread_mutex_t *,
ACE_OS_Object_Manager::preallocated_object[ACE_TSS_CLEANUP_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::fini, ACE_TSS_CLEANUP_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::fini, ACE_TSS_CLEANUP_LOCK")));
# endif /* ! __Lynx__ */
ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_recursive_thread_mutex_t,
ACE_TSS_CLEANUP_LOCK)
+# if !defined (__Lynx__)
+ // LynxOS 3.0.0 has problems with this after fork.
+ if (ACE_OS::thread_mutex_destroy (ACE_reinterpret_cast (
+ ACE_thread_mutex_t *,
+ ACE_OS_Object_Manager::preallocated_object
+ [ACE_LOG_MSG_INSTANCE_LOCK])) != 0)
+ ACE_ERROR ((LM_ERROR,
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::fini, ")
+ ASYS_TEXT ("ACE_LOG_MSG_INSTANCE_LOCK")));
+# endif /* ! __Lynx__ */
+ ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_thread_mutex_t,
+ ACE_LOG_MSG_INSTANCE_LOCK)
# if defined (ACE_HAS_TSS_EMULATION)
# if !defined (__Lynx__)
// LynxOS 3.0.0 has problems with this after fork.
@@ -6483,8 +6507,8 @@ ACE_OS_Object_Manager::fini (void)
ACE_OS_Object_Manager::preallocated_object[
ACE_TSS_KEY_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::fini, ACE_TSS_KEY_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::fini, ACE_TSS_KEY_LOCK")));
# endif /* ! __Lynx__ */
ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_recursive_thread_mutex_t,
ACE_TSS_KEY_LOCK)
@@ -6496,8 +6520,8 @@ ACE_OS_Object_Manager::fini (void)
ACE_OS_Object_Manager::preallocated_object[
ACE_TSS_BASE_LOCK])) != 0)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT("%p\n"),
- ASYS_TEXT("ACE_OS_Object_Manager::fini, ACE_TSS_BASE_LOCK")));
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS_Object_Manager::fini, ACE_TSS_BASE_LOCK")));
# endif /* ! __Lynx__ */
ACE_OS_DELETE_PREALLOCATED_OBJECT (ACE_recursive_thread_mutex_t,
ACE_TSS_BASE_LOCK)
diff --git a/ace/OS.h b/ace/OS.h
index b650d505d41..a5b1385e984 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -6764,6 +6764,7 @@ public:
# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
ACE_OS_MONITOR_LOCK,
ACE_TSS_CLEANUP_LOCK,
+ ACE_LOG_MSG_INSTANCE_LOCK,
# if defined (ACE_HAS_TSS_EMULATION)
ACE_TSS_KEY_LOCK,
# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)
@@ -6798,6 +6799,7 @@ private:
friend class ACE_OS_Object_Manager_Manager;
friend class ACE_TSS_Cleanup;
friend class ACE_TSS_Emulation;
+ friend class ACE_Log_Msg;
friend void ACE_OS_Object_Manager_Internal_Exit_Hook ();
// This class is for internal use by ACE_OS, etc., only.
diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp
index 94ec9afa053..a5b09500888 100644
--- a/ace/Object_Manager.cpp
+++ b/ace/Object_Manager.cpp
@@ -201,8 +201,6 @@ ACE_Object_Manager::init (void)
# endif /* ACE_HAS_THREADS */
# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
ACE_PREALLOCATE_OBJECT (ACE_Thread_Mutex,
- ACE_LOG_MSG_INSTANCE_LOCK)
- ACE_PREALLOCATE_OBJECT (ACE_Thread_Mutex,
ACE_MT_CORBA_HANDLER_LOCK)
ACE_PREALLOCATE_OBJECT (ACE_Thread_Mutex, ACE_DUMP_LOCK)
ACE_PREALLOCATE_OBJECT (ACE_Recursive_Thread_Mutex,
@@ -661,8 +659,6 @@ ACE_Object_Manager::fini (void)
#endif /* ACE_HAS_THREADS */
# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
ACE_DELETE_PREALLOCATED_OBJECT (ACE_Thread_Mutex,
- ACE_LOG_MSG_INSTANCE_LOCK)
- ACE_DELETE_PREALLOCATED_OBJECT (ACE_Thread_Mutex,
ACE_MT_CORBA_HANDLER_LOCK)
ACE_DELETE_PREALLOCATED_OBJECT (ACE_Thread_Mutex, ACE_DUMP_LOCK)
ACE_DELETE_PREALLOCATED_OBJECT (ACE_Recursive_Thread_Mutex,
diff --git a/ace/Object_Manager.h b/ace/Object_Manager.h
index f9b6db943d9..f66472a1d53 100644
--- a/ace/Object_Manager.h
+++ b/ace/Object_Manager.h
@@ -251,7 +251,6 @@ public:
ACE_STATIC_OBJECT_LOCK,
#endif /* ACE_HAS_THREADS */
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
- ACE_LOG_MSG_INSTANCE_LOCK,
ACE_MT_CORBA_HANDLER_LOCK,
ACE_DUMP_LOCK,
ACE_SIG_HANDLER_LOCK,