9#include <boost/thread/locks.hpp>
10#include <boost/interprocess/sync/interprocess_mutex.hpp>
11#include <boost/interprocess/sync/interprocess_condition.hpp>
18namespace Arp {
namespace System {
namespace Commons {
namespace Ipc
27 typedef std::shared_ptr<AutoResetEvent>
Ptr;
45 bool WaitOne(
unsigned long timeoutMs = 0);
48 bool WaitOneInfinite(
void);
49 bool TimedWaitOne(
unsigned long timeoutMs);
57 boost::interprocess::interprocess_mutex syncRoot;
58 boost::interprocess::interprocess_condition signal;
70 boost::lock_guard<boost::interprocess::interprocess_mutex> lock(this->syncRoot);
72 this->signal.notify_one();
77 boost::lock_guard<boost::interprocess::interprocess_mutex> lock(this->syncRoot);
83 return (timeoutMs == 0) ? WaitOneInfinite() : TimedWaitOne(timeoutMs);
86inline bool AutoResetEvent::WaitOneInfinite()
88 boost::unique_lock<boost::interprocess::interprocess_mutex> lock(this->syncRoot);
91 this->signal.wait(lock);
Ipc-ready variant of Arp::System::Commons::Threading::AutoResetEvent
Definition: AutoResetEvent.hpp:24
std::shared_ptr< AutoResetEvent > Ptr
Definition of a pointer in the contet of an AutoResetEvent.
Definition: AutoResetEvent.hpp:27
AutoResetEvent(bool initial=false)
Creates a new object with specified initial state.
Definition: AutoResetEvent.hpp:63
void Set(void)
Sets the event to signaled state.
Definition: AutoResetEvent.hpp:68
bool WaitOne(unsigned long timeoutMs=0)
Suspends thread execution until event is signaled by another thread.
Definition: AutoResetEvent.hpp:81
void Reset(void)
Resets the event state to non-signaled.
Definition: AutoResetEvent.hpp:75
Root namespace for the PLCnext API