Use override/default for RTPortableServer
[ACE_TAO.git] / ACE / ace / Semaphore.cpp
blob63cbf87769ee1c217b52938cb4517d84989184fc
1 #include "ace/Semaphore.h"
3 #if !defined (__ACE_INLINE__)
4 #include "ace/Semaphore.inl"
5 #endif /* __ACE_INLINE__ */
7 #include "ace/Log_Category.h"
8 #include "ace/ACE.h"
9 #if defined (ACE_HAS_ALLOC_HOOKS)
10 # include "ace/Malloc_Base.h"
11 #endif /* ACE_HAS_ALLOC_HOOKS */
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 ACE_ALLOC_HOOK_DEFINE(ACE_Semaphore)
17 void
18 ACE_Semaphore::dump () const
20 #if defined (ACE_HAS_DUMP)
21 // ACE_TRACE ("ACE_Semaphore::dump");
23 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
24 ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\n")));
25 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
26 #endif /* ACE_HAS_DUMP */
29 ACE_Semaphore::ACE_Semaphore (unsigned int count,
30 int type,
31 const ACE_TCHAR *name,
32 void *arg,
33 int max)
34 : removed_ (false)
36 // ACE_TRACE ("ACE_Semaphore::ACE_Semaphore");
37 #if defined(ACE_LACKS_UNNAMED_SEMAPHORE)
38 // if the user does not provide a name, we generate a unique name here
39 ACE_TCHAR iname[ACE_UNIQUE_NAME_LEN];
40 if (name == 0)
41 ACE::unique_name (this, iname, ACE_UNIQUE_NAME_LEN);
42 if (ACE_OS::sema_init (&this->semaphore_, count, type,
43 name ? name : iname,
44 arg, max) != 0)
45 #else
46 if (ACE_OS::sema_init (&this->semaphore_, count, type,
47 name, arg, max) != 0)
48 #endif
49 ACELIB_ERROR ((LM_ERROR,
50 ACE_TEXT ("%p\n"),
51 ACE_TEXT ("ACE_Semaphore::ACE_Semaphore")));
54 ACE_Semaphore::~ACE_Semaphore ()
56 // ACE_TRACE ("ACE_Semaphore::~ACE_Semaphore");
58 this->remove ();
61 ACE_END_VERSIONED_NAMESPACE_DECL