1 // $Id: Process_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #include "ace/Process_Mutex.h"
4 #include "ace/Log_Msg.h"
6 #include "ace/Guard_T.h"
7 #include "ace/Process_Mutex.h"
8 #include "ace/Malloc_T.h"
10 #if !defined (__ACE_INLINE__)
11 #include "ace/Process_Mutex.inl"
12 #endif /* __ACE_INLINE__ */
14 ACE_RCSID(ace
, Process_Mutex
, "$Id: Process_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $")
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
18 ACE_ALLOC_HOOK_DEFINE(ACE_Process_Mutex
)
21 ACE_Process_Mutex::dump (void) const
23 #if defined (ACE_HAS_DUMP)
24 // ACE_TRACE ("ACE_Process_Mutex::dump");
25 ACE_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
27 ACE_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
28 #endif /* ACE_HAS_DUMP */
32 ACE_Process_Mutex::unique_name (void)
34 // For all platforms other than Win32, we are going to create a
35 // machine-wide unique name if one is not provided by the user. On
36 // Win32, unnamed synchronization objects are acceptable.
37 ACE::unique_name (this, this->name_
, ACE_UNIQUE_NAME_LEN
);
41 ACE_Process_Mutex::ACE_Process_Mutex (const char *name
, void *arg
, mode_t mode
)
42 #if defined (_ACE_USE_SV_SEM)
43 : lock_ (name
? name
: ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
44 ACE_SV_Semaphore_Complex::ACE_CREATE
,
49 : lock_ (USYNC_PROCESS
,
51 ACE_TEXT_CHAR_TO_TCHAR (name
) : this->unique_name (),
52 (ACE_mutexattr_t
*) arg
,
54 #endif /* _ACE_USE_SV_SEM */
56 #if defined (_ACE_USE_SV_SEM)
58 #endif /* !_ACE_USE_SV_SEM */
61 #if defined (ACE_HAS_WCHAR)
62 ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name
,
65 #if defined (_ACE_USE_SV_SEM)
67 ACE_Wide_To_Ascii (name
).char_rep () :
68 ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
69 ACE_SV_Semaphore_Complex::ACE_CREATE
,
74 : lock_ (USYNC_PROCESS
,
76 ACE_TEXT_WCHAR_TO_TCHAR (name
) : this->unique_name (),
77 (ACE_mutexattr_t
*) arg
,
79 #endif /* _ACE_USE_SV_SEM */
81 #if defined (_ACE_USE_SV_SEM)
83 #endif /* _ACE_USE_SV_SEM */
85 #endif /* ACE_HAS_WCHAR */
86 ACE_Process_Mutex::~ACE_Process_Mutex (void)
90 ACE_END_VERSIONED_NAMESPACE_DECL