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"
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
)
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
,
31 const ACE_TCHAR
*name
,
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
];
41 ACE::unique_name (this, iname
, ACE_UNIQUE_NAME_LEN
);
42 if (ACE_OS::sema_init (&this->semaphore_
, count
, type
,
46 if (ACE_OS::sema_init (&this->semaphore_
, count
, type
,
49 ACELIB_ERROR ((LM_ERROR
,
51 ACE_TEXT ("ACE_Semaphore::ACE_Semaphore")));
54 ACE_Semaphore::~ACE_Semaphore ()
56 // ACE_TRACE ("ACE_Semaphore::~ACE_Semaphore");
61 ACE_END_VERSIONED_NAMESPACE_DECL