diff options
author | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
commit | e585187b248f48b3c6e9247b49fa07c6565d65e5 (patch) | |
tree | 637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /dep/ACE_wrappers/ace/Event.h | |
parent | 26b5e033ffde3d161382fc9addbfa99738379641 (diff) |
*Backed out changeset 3be01fb200a5
--HG--
branch : trunk
Diffstat (limited to 'dep/ACE_wrappers/ace/Event.h')
-rw-r--r-- | dep/ACE_wrappers/ace/Event.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dep/ACE_wrappers/ace/Event.h b/dep/ACE_wrappers/ace/Event.h index 3c9f744a9c4..69d819b3978 100644 --- a/dep/ACE_wrappers/ace/Event.h +++ b/dep/ACE_wrappers/ace/Event.h @@ -1,4 +1,5 @@ // -*- C++ -*- + //========================================================================== /** * @file Event.h @@ -10,15 +11,21 @@ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> */ //========================================================================== + #ifndef ACE_EVENT_H #define ACE_EVENT_H #include /**/ "ace/pre.h" + #include /**/ "ace/ACE_export.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/OS_NS_Thread.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL + /** * @class ACE_Event * @@ -39,16 +46,20 @@ public: const ACE_TCHAR *name = 0, void *arg = 0, LPSECURITY_ATTRIBUTES sa = 0); + /// Implicitly destroy the event variable. ~ACE_Event (void); + /** * Explicitly destroy the event variable. Note that only one thread * should call this method since it doesn't protect against race * conditions. */ int remove (void); + /// Underlying handle to event. ACE_event_t handle (void) const; + /** * Set the underlying handle to event. Note that this method assumes * ownership of the <handle> and will close it down in <remove>. If @@ -58,6 +69,7 @@ public: * overwriting it. */ void handle (ACE_event_t new_handle); + /** * if MANUAL reset * sleep till the event becomes signaled @@ -67,11 +79,13 @@ public: * event resets wait() completes. */ int wait (void); + /// Same as wait() above, but this one can be timed /// @a abstime is absolute time-of-day if if @a use_absolute_time /// is non-0, else it is relative time. int wait (const ACE_Time_Value *abstime, int use_absolute_time = 1); + /** * if MANUAL reset * wake up all waiting threads @@ -82,6 +96,7 @@ public: * reset event */ int signal (void); + /** * if MANUAL reset * wakeup all waiting threads and @@ -91,30 +106,39 @@ public: * reset event */ int pulse (void); + /// Set to nonsignaled state. int reset (void); + /// Dump the state of an object. void dump (void) const; + /// Declare the dynamic allocation hooks ACE_ALLOC_HOOK_DECLARE; + protected: /// The underlying handle. ACE_event_t handle_; + /// Keeps track of whether <remove> has been called yet to avoid /// multiple <remove> calls, e.g., explicitly and implicitly in the /// destructor. This flag isn't protected by a lock, so make sure /// that you don't have multiple threads simultaneously calling /// <remove> on the same object, which is a bad idea anyway... bool removed_; + private: // = Prevent copying. ACE_Event (const ACE_Event& event); const ACE_Event &operator= (const ACE_Event &rhs); }; + ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/Event.inl" #endif /* __ACE_INLINE__ */ + #include /**/ "ace/post.h" #endif /* ACE_EVENT_H */ |