Tkrzw
|
Handler to wait for the signal. More...
#include <tkrzw_thread_util.h>
Public Member Functions | |
Waiter (KeySignalBroker *broker, const KEYTYPE &key) | |
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.
tkrzw::KeySignalBroker< KEYTYPE >::Waiter::Waiter | ( | KeySignalBroker * | broker, |
const KEYTYPE & | key | ||
) |
Constructor.
broker | The broker object. |
key | The key of the signal. |
tkrzw::KeySignalBroker< KEYTYPE >::Waiter::~Waiter |
Destructor.
bool tkrzw::KeySignalBroker< KEYTYPE >::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.