1 #include "ace/Process_Mutex.h"
2 #include "ace/Log_Category.h"
4 #include "ace/Guard_T.h"
5 #include "ace/Process_Mutex.h"
6 #include "ace/Malloc_T.h"
8 #if !defined (__ACE_INLINE__)
9 #include "ace/Process_Mutex.inl"
10 #endif /* __ACE_INLINE__ */
12 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
14 ACE_ALLOC_HOOK_DEFINE(ACE_Process_Mutex
)
17 ACE_Process_Mutex::dump () const
19 #if defined (ACE_HAS_DUMP)
20 // ACE_TRACE ("ACE_Process_Mutex::dump");
21 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
23 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
24 #endif /* ACE_HAS_DUMP */
28 ACE_Process_Mutex::unique_name ()
30 // For all platforms other than Win32, we are going to create a
31 // machine-wide unique name if one is not provided by the user. On
32 // Win32, unnamed synchronization objects are acceptable.
33 ACE::unique_name (this, this->name_
, ACE_UNIQUE_NAME_LEN
);
38 ACE_Process_Mutex::unlink (const ACE_TCHAR
*name
)
40 #if defined (_ACE_USE_SV_SEM)
41 ACE_UNUSED_ARG (name
);
44 return ACE_Mutex::unlink (name
);
48 ACE_Process_Mutex::ACE_Process_Mutex (const char *name
, void *arg
, mode_t mode
)
49 #if defined (_ACE_USE_SV_SEM)
50 : lock_ (name
? name
: ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
51 ACE_SV_Semaphore_Complex::ACE_CREATE
,
56 : lock_ (USYNC_PROCESS
,
58 ACE_TEXT_CHAR_TO_TCHAR (name
) : this->unique_name (),
59 (ACE_mutexattr_t
*) arg
,
61 #endif /* _ACE_USE_SV_SEM */
63 #if defined (_ACE_USE_SV_SEM)
65 #endif /* !_ACE_USE_SV_SEM */
68 #if defined (ACE_HAS_WCHAR)
69 ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name
,
72 #if defined (_ACE_USE_SV_SEM)
74 ACE_Wide_To_Ascii (name
).char_rep () :
75 ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
76 ACE_SV_Semaphore_Complex::ACE_CREATE
,
81 : lock_ (USYNC_PROCESS
,
83 ACE_TEXT_WCHAR_TO_TCHAR (name
) : this->unique_name (),
84 (ACE_mutexattr_t
*) arg
,
86 #endif /* _ACE_USE_SV_SEM */
88 #if defined (_ACE_USE_SV_SEM)
90 #endif /* _ACE_USE_SV_SEM */
92 #endif /* ACE_HAS_WCHAR */
93 ACE_Process_Mutex::~ACE_Process_Mutex ()
97 ACE_END_VERSIONED_NAMESPACE_DECL