00001 #include "ace_pch.h"
00002
00003
00004 #include "ace/Process_Mutex.h"
00005 #include "ace/Synch.h"
00006 #include "ace/Log_Msg.h"
00007 #include "ace/ACE.h"
00008
00009 #if !defined (__ACE_INLINE__)
00010 #include "ace/Process_Mutex.inl"
00011 #endif
00012
00013 ACE_RCSID(ace, Process_Mutex, "$Id: Process_Mutex.cpp,v 1.1.1.2.2.1 2003/03/13 19:44:22 chad Exp $")
00014
00015 ACE_ALLOC_HOOK_DEFINE(ACE_Process_Mutex)
00016
00017 void
00018 ACE_Process_Mutex::dump (void) const
00019 {
00020
00021 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00022 this->lock_.dump ();
00023 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00024 }
00025
00026 const ACE_TCHAR *
00027 ACE_Process_Mutex::unique_name (void)
00028 {
00029
00030
00031
00032 ACE::unique_name (this, this->name_, ACE_UNIQUE_NAME_LEN);
00033 return this->name_;
00034 }
00035
00036 ACE_Process_Mutex::ACE_Process_Mutex (const char *name, void *arg, mode_t mode)
00037 #if defined (_ACE_USE_SV_SEM)
00038 : lock_ (name ?
00039 ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (),
00040 ACE_SV_Semaphore_Complex::ACE_CREATE,
00041 1,
00042 1,
00043 mode)
00044 #else
00045 : lock_ (USYNC_PROCESS,
00046 name ?
00047 ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (),
00048 (ACE_mutexattr_t *) arg,
00049 mode)
00050 #endif
00051 {
00052 #if defined (_ACE_USE_SV_SEM)
00053 ACE_UNUSED_ARG (arg);
00054 #endif
00055 }
00056
00057 #if defined (ACE_HAS_WCHAR)
00058 ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name,
00059 void *arg,
00060 mode_t mode)
00061 #if defined (_ACE_USE_SV_SEM)
00062 : lock_ (name ?
00063 ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (),
00064 ACE_SV_Semaphore_Complex::ACE_CREATE,
00065 1,
00066 1,
00067 mode)
00068 #else
00069 : lock_ (USYNC_PROCESS,
00070 name ?
00071 ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (),
00072 (ACE_mutexattr_t *) arg,
00073 mode)
00074 #endif
00075 {
00076 #if defined (_ACE_USE_SV_SEM)
00077 ACE_UNUSED_ARG (arg);
00078 #endif
00079 }
00080 #endif
00081 ACE_Process_Mutex::~ACE_Process_Mutex (void)
00082 {
00083 }
00084
00085
00086
00087
00088 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
00089
00090 template class ACE_Guard<ACE_Process_Mutex>;
00091
00092 #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
00093
00094 #pragma instantiate ACE_Guard<ACE_Process_Mutex>
00095
00096 #endif