Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Process_Mutex.cpp
blob5e89bf7c23ab2bf1b10aff0910bb3f22048aec36
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__ */
12 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
14 ACE_ALLOC_HOOK_DEFINE(ACE_Process_Mutex)
16 void
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));
22 this->lock_.dump ();
23 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
24 #endif /* ACE_HAS_DUMP */
27 const ACE_TCHAR *
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);
34 return this->name_;
37 int
38 ACE_Process_Mutex::unlink (const ACE_TCHAR *name)
40 #if defined (_ACE_USE_SV_SEM)
41 ACE_UNUSED_ARG (name);
42 return 0;
43 #else
44 return ACE_Mutex::unlink (name);
45 #endif
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,
54 mode)
55 #else
56 : lock_ (USYNC_PROCESS,
57 name ?
58 ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (),
59 (ACE_mutexattr_t *) arg,
60 mode)
61 #endif /* _ACE_USE_SV_SEM */
63 #if defined (_ACE_USE_SV_SEM)
64 ACE_UNUSED_ARG (arg);
65 #endif /* !_ACE_USE_SV_SEM */
68 #if defined (ACE_HAS_WCHAR)
69 ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name,
70 void *arg,
71 mode_t mode)
72 #if defined (_ACE_USE_SV_SEM)
73 : lock_ (name ?
74 ACE_Wide_To_Ascii (name).char_rep () :
75 ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
76 ACE_SV_Semaphore_Complex::ACE_CREATE,
79 mode)
80 #else
81 : lock_ (USYNC_PROCESS,
82 name ?
83 ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (),
84 (ACE_mutexattr_t *) arg,
85 mode)
86 #endif /* _ACE_USE_SV_SEM */
88 #if defined (_ACE_USE_SV_SEM)
89 ACE_UNUSED_ARG (arg);
90 #endif /* _ACE_USE_SV_SEM */
92 #endif /* ACE_HAS_WCHAR */
93 ACE_Process_Mutex::~ACE_Process_Mutex ()
97 ACE_END_VERSIONED_NAMESPACE_DECL