Tkrzw
|
Handler to wait for the signal. More...
#include <tkrzw_thread_util.h>
Public Member Functions | |
Waiter (SignalBroker *broker) | |
Constructor. More... | |
~Waiter () | |
Destructor. More... | |
bool | Wait (double timeout=-1) |
Waits for a signal to happen. More... | |
Handler to wait for the signal.
The constructor should be called before checking the resource. Then, the Wait method should be called if the resource state doesn't satisfy the required condition.
|
explicit |
Constructor.
broker | The broker object. |
tkrzw::SignalBroker::Waiter::~Waiter | ( | ) |
Destructor.
bool tkrzw::SignalBroker::Waiter::Wait | ( | double | timeout = -1 | ) |
Waits for a signal to happen.
timeout | The timeout in seconds to wait. Zero means no wait. Negative means unlimited. |
This detects only signals which happen during this method is running. In other words, signals which were sent before the call are not ignored.