Robot Raconteur Core C++ Library
AutoResetEvent.h
Go to the documentation of this file.
1 
24 #pragma once
25 
27 
28 namespace RobotRaconteur
29 {
35 class ROBOTRACONTEUR_CORE_API AutoResetEvent : private boost::noncopyable
36 {
37  public:
39  virtual ~AutoResetEvent();
40 
42  virtual void Set();
43 
45  virtual void Reset();
46 
48  virtual void WaitOne();
49 
60  virtual bool WaitOne(int32_t timeout);
61 #ifdef ROBOTRACONTEUR_WINDOWS
62  private:
63  void* ev;
64 #else
65  private:
66  volatile bool m_bSet;
67  boost::condition_variable m_setCondition;
68  boost::mutex m_mutex;
69 #endif
70 };
71 
72 } // namespace RobotRaconteur
Synchronization event for thread synchronization. Resets automatically after being triggered.
Definition: AutoResetEvent.h:36
virtual void Set()
Set the event, releasing waiting threads.
virtual void Reset()
Reset the event.
virtual bool WaitOne(int32_t timeout)
Block the current thread until Set() is called, or timeout expires.
virtual void WaitOne()
Block the current thread infinitely until Set() is called.