Correct feature names
[ACE_TAO.git] / ACE / ace / Process_Mutex.cpp
blob3a13726799025dfc5c4c955ca74bffcc2d5d51dd
1 #include "ace/Process_Mutex.h"
2 #include "ace/Log_Category.h"
3 #include "ace/ACE.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__ */
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 ACE_ALLOC_HOOK_DEFINE(ACE_Process_Mutex)
18 void
19 ACE_Process_Mutex::dump (void) const
21 #if defined (ACE_HAS_DUMP)
22 // ACE_TRACE ("ACE_Process_Mutex::dump");
23 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
24 this->lock_.dump ();
25 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
26 #endif /* ACE_HAS_DUMP */
29 const ACE_TCHAR *
30 ACE_Process_Mutex::unique_name (void)
32 // For all platforms other than Win32, we are going to create a
33 // machine-wide unique name if one is not provided by the user. On
34 // Win32, unnamed synchronization objects are acceptable.
35 ACE::unique_name (this, this->name_, ACE_UNIQUE_NAME_LEN);
36 return this->name_;
39 int
40 ACE_Process_Mutex::unlink (const ACE_TCHAR *name)
42 #if defined (_ACE_USE_SV_SEM)
43 ACE_UNUSED_ARG (name);
44 return 0;
45 #else
46 return ACE_Mutex::unlink (name);
47 #endif
50 ACE_Process_Mutex::ACE_Process_Mutex (const char *name, void *arg, mode_t mode)
51 #if defined (_ACE_USE_SV_SEM)
52 : lock_ (name ? name : ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
53 ACE_SV_Semaphore_Complex::ACE_CREATE,
56 mode)
57 #else
58 : lock_ (USYNC_PROCESS,
59 name ?
60 ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (),
61 (ACE_mutexattr_t *) arg,
62 mode)
63 #endif /* _ACE_USE_SV_SEM */
65 #if defined (_ACE_USE_SV_SEM)
66 ACE_UNUSED_ARG (arg);
67 #endif /* !_ACE_USE_SV_SEM */
70 #if defined (ACE_HAS_WCHAR)
71 ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name,
72 void *arg,
73 mode_t mode)
74 #if defined (_ACE_USE_SV_SEM)
75 : lock_ (name ?
76 ACE_Wide_To_Ascii (name).char_rep () :
77 ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
78 ACE_SV_Semaphore_Complex::ACE_CREATE,
81 mode)
82 #else
83 : lock_ (USYNC_PROCESS,
84 name ?
85 ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (),
86 (ACE_mutexattr_t *) arg,
87 mode)
88 #endif /* _ACE_USE_SV_SEM */
90 #if defined (_ACE_USE_SV_SEM)
91 ACE_UNUSED_ARG (arg);
92 #endif /* _ACE_USE_SV_SEM */
94 #endif /* ACE_HAS_WCHAR */
95 ACE_Process_Mutex::~ACE_Process_Mutex (void)
99 ACE_END_VERSIONED_NAMESPACE_DECL