Kyoto Cabinet
Public Member Functions
kyotocabinet::CondVar Class Reference

Condition variable. More...

#include <kcthread.h>

List of all members.

Public Member Functions

 CondVar ()
 Default constructor.
 ~CondVar ()
 Destructor.
void wait (Mutex *mutex)
 Wait for the signal.
bool wait (Mutex *mutex, double sec)
 Wait for the signal.
void signal ()
 Send the wake-up signal to another waiting thread.
void broadcast ()
 Send the wake-up signals to all waiting threads.

Detailed Description

Condition variable.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

Wait for the signal.

Parameters:
mutexa locked mutex.
bool kyotocabinet::CondVar::wait ( Mutex mutex,
double  sec 
)

Wait for the signal.

Parameters:
mutexa locked mutex.
secthe interval of the suspension in seconds.
Returns:
true on catched signal, or false on timeout.

Send the wake-up signal to another waiting thread.

Note:
The mutex used for the wait method should be locked by the caller.

Send the wake-up signals to all waiting threads.

Note:
The mutex used for the wait method should be locked by the caller.