summaryrefslogtreecommitdiff
path: root/ace/Process_Mutex.cpp
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-20 19:04:19 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-20 19:04:19 +0000
commit2060687536c91f24e7bb65fa5b736d6ee4c99ec3 (patch)
treef6362ad44f43a5709aa6dfe1706fbd5e2e47564d /ace/Process_Mutex.cpp
parent2e69153ee4578068fa6d52001411a87d52274fc5 (diff)
downloadATCD-2060687536c91f24e7bb65fa5b736d6ee4c99ec3.tar.gz
ChangeLogTag:Wed Sep 20 12:00:42 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'ace/Process_Mutex.cpp')
-rw-r--r--ace/Process_Mutex.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/ace/Process_Mutex.cpp b/ace/Process_Mutex.cpp
new file mode 100644
index 00000000000..7d8d3500d0b
--- /dev/null
+++ b/ace/Process_Mutex.cpp
@@ -0,0 +1,63 @@
+// $Id$
+
+#include "ace/Process_Mutex.h"
+#include "ace/Synch.h"
+#include "ace/Log_Msg.h"
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Process_Mutex.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(ace, Process_Mutex, "$Id$")
+
+ACE_ALLOC_HOOK_DEFINE(ACE_Process_Mutex)
+
+void
+ACE_Process_Mutex::dump (void) const
+{
+// ACE_TRACE ("ACE_Process_Mutex::dump");
+ ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
+ this->lock_.dump ();
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+}
+
+#if !defined (ACE_WIN32) && !defined (ACE_HAS_POSIX_SEM) && !defined (ACE_PSOS)
+const ACE_TCHAR *
+ACE_Process_Mutex::unique_name (void)
+{
+ // For all platforms other than Win32, we are going to create a
+ // machine wide unquie name if one is not provided by the user. On
+ // Win32, unnamed synchronization objects are acceptable.
+ ACE::unique_name (this, this->name_, ACE_UNIQUE_NAME_LEN);
+ return this->name_;
+}
+#endif /* !ACE_WIN32 && !ACE_HAS_POSIX_SEM && !ACE_PSOS */
+
+ACE_Process_Mutex::ACE_Process_Mutex (const ACE_TCHAR *name, void *arg)
+#if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM) || defined (ACE_PSOS)
+ : lock_ (USYNC_PROCESS, name, (ACE_mutexattr_t *) arg)
+#else
+ : lock_ (name ? name : ACE_Process_Mutex::unique_name ())
+#endif /* ACE_WIN32 || ACE_HAS_POSIX_SEM || ACE_PSOS */
+{
+#if !defined (ACE_WIN32) && !defined (ACE_HAS_POSIX_SEM) && !defined (ACE_PSOS)
+ ACE_UNUSED_ARG (arg);
+#endif /* !ACE_WIN32 && !ACE_HAS_POSIX_SEM && !ACE_PSOS */
+}
+
+ACE_Process_Mutex::~ACE_Process_Mutex (void)
+{
+}
+
+//
+// These are instantiated both with and without ACE_HAS_THREADS.
+//
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+
+template class ACE_Guard<ACE_Process_Mutex>;
+
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+
+#pragma instantiate ACE_Guard<ACE_Process_Mutex>
+
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */