Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / Process_Mutex.cpp
blob95d6529d933f7c694ccaf4dc480dd8101560a0ec
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"
5 #include "ace/ACE.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)
20 void
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));
26 this->lock_.dump ();
27 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
28 #endif /* ACE_HAS_DUMP */
31 const ACE_TCHAR *
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);
38 return this->name_;
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,
47 mode)
48 #else
49 : lock_ (USYNC_PROCESS,
50 name ?
51 ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (),
52 (ACE_mutexattr_t *) arg,
53 mode)
54 #endif /* _ACE_USE_SV_SEM */
56 #if defined (_ACE_USE_SV_SEM)
57 ACE_UNUSED_ARG (arg);
58 #endif /* !_ACE_USE_SV_SEM */
61 #if defined (ACE_HAS_WCHAR)
62 ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name,
63 void *arg,
64 mode_t mode)
65 #if defined (_ACE_USE_SV_SEM)
66 : lock_ (name ?
67 ACE_Wide_To_Ascii (name).char_rep () :
68 ACE_TEXT_ALWAYS_CHAR (this->unique_name ()),
69 ACE_SV_Semaphore_Complex::ACE_CREATE,
72 mode)
73 #else
74 : lock_ (USYNC_PROCESS,
75 name ?
76 ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (),
77 (ACE_mutexattr_t *) arg,
78 mode)
79 #endif /* _ACE_USE_SV_SEM */
81 #if defined (_ACE_USE_SV_SEM)
82 ACE_UNUSED_ARG (arg);
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