Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / Event.cpp
blobea5f86d99d1ca02cee4573fc264923218ea24b51
1 // $Id: Event.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #include "ace/Event.h"
5 #if !defined (__ACE_INLINE__)
6 #include "ace/Event.inl"
7 #endif /* __ACE_INLINE__ */
9 #include "ace/Log_Msg.h"
11 ACE_RCSID(ace, Event, "$Id: Event.cpp 80826 2008-03-04 14:51:23Z wotte $")
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 ACE_Event::ACE_Event (int manual_reset,
16 int initial_state,
17 int type,
18 const ACE_TCHAR *name,
19 void *arg,
20 LPSECURITY_ATTRIBUTES sa)
21 : removed_ (false)
23 if (ACE_OS::event_init (&this->handle_,
24 manual_reset,
25 initial_state,
26 type,
27 name,
28 arg,
29 sa) != 0)
30 ACE_ERROR ((LM_ERROR,
31 ACE_TEXT ("%p\n"),
32 ACE_TEXT ("ACE_Event::ACE_Event")));
35 ACE_Event::~ACE_Event (void)
37 this->remove ();
40 int
41 ACE_Event::remove (void)
43 int result = 0;
44 if (!this->removed_)
46 this->removed_ = true;
47 result = ACE_OS::event_destroy (&this->handle_);
49 return result;
52 int
53 ACE_Event::wait (void)
55 return ACE_OS::event_wait (&this->handle_);
58 int
59 ACE_Event::wait (const ACE_Time_Value *abstime, int use_absolute_time)
61 return ACE_OS::event_timedwait (&this->handle_,
62 const_cast <ACE_Time_Value *> (abstime),
63 use_absolute_time);
66 int
67 ACE_Event::signal (void)
69 return ACE_OS::event_signal (&this->handle_);
72 int
73 ACE_Event::pulse (void)
75 return ACE_OS::event_pulse (&this->handle_);
78 int
79 ACE_Event::reset (void)
81 return ACE_OS::event_reset (&this->handle_);
84 void
85 ACE_Event::dump (void) const
87 #if defined (ACE_HAS_DUMP)
88 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
89 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
90 #endif /* ACE_HAS_DUMP */
93 ACE_END_VERSIONED_NAMESPACE_DECL