Event object to signal a single thread that an event has occurred. Can be used to synchronize threads in different processes.
More...
#include <ManualResetEvent.hpp>
|
| ManualResetEvent (bool initial=false) |
| Creates a new object with specified initial state. More...
|
|
| ManualResetEvent (const ManualResetEvent &arg)=delete |
|
| ManualResetEvent (ManualResetEvent &&arg) noexcept |
| Default move constructor.
|
|
ManualResetEvent & | operator= (const ManualResetEvent &arg)=delete |
|
ManualResetEvent & | operator= (ManualResetEvent &&arg) noexcept |
| Default move-assignment operator.
|
|
| ~ManualResetEvent () |
| Default destructor.
|
|
void | Set (void) |
| Sets the event to signaled state. More...
|
|
void | Reset (void) |
| Resets the event state to non-signaled.
|
|
bool | WaitOne (uint64 timeoutMs=0) |
| Suspends thread execution until event is signaled by another thread. More...
|
|
void | WaitOneInfinite (void) |
| Suspends thread execution until event is signaled by another thread.
|
|
bool | WaitOneTimed (uint64 timeoutMs) |
| Suspends thread execution until event is signaled by another thread. More...
|
|
Impl & | GetImpl (void) |
| For internal use only.
|
|
const Impl & | GetImpl (void) const |
|
Event object to signal a single thread that an event has occurred. Can be used to synchronize threads in different processes.
Manual-reset events can be used to signal multiple threads about the occurrence of specific events. The threads to be informed have to call WaitOne() and then block until another thread calls Set to inform the waiters about the event occurrence. The internal state remains signalled until someone calls a manually Reset() for this event. If an event is signalled, all succeeding calls to WaitOne() will instantly signal the event again until Reset() is called for this event.
◆ ManualResetEvent()
Arp::System::Commons::Threading::ManualResetEvent::ManualResetEvent |
( |
bool |
initial = false | ) |
|
|
explicit |
Creates a new object with specified initial state.
- Parameters
-
initial | Initial state of event. |
◆ Set()
void Arp::System::Commons::Threading::ManualResetEvent::Set |
( |
void |
| ) |
|
Sets the event to signaled state.
Causes all threads waiting on this event to resume its execution.
◆ WaitOne()
bool Arp::System::Commons::Threading::ManualResetEvent::WaitOne |
( |
uint64 |
timeoutMs = 0 | ) |
|
Suspends thread execution until event is signaled by another thread.
- Parameters
-
timeoutMs | Timeout in milliseconds to wait for the event to become signaled. If the value is set to 0 (default) the calling thread will wait infinitly or until the event is set. |
- Returns
- Returns false if the timeout was reached before the event was signaled, otherwise true is returned.
◆ WaitOneTimed()
bool Arp::System::Commons::Threading::ManualResetEvent::WaitOneTimed |
( |
uint64 |
timeoutMs | ) |
|
Suspends thread execution until event is signaled by another thread.
- Parameters
-
timeoutMs | Timeout in milliseconds to wait for the event to become signaled. |
- Returns
- Returns false if the timeout was reached before the event was signaled, otherwise true is returned.
The documentation for this class was generated from the following files: