Assosiative condition variable.
More...
#include <kcthread.h>
List of all members.
Classes |
struct | Count |
| Counter for waiting threads.
|
struct | Slot |
| Slot of a key space.
|
Public Member Functions |
| CondMap () |
| Default constructor.
|
| ~CondMap () |
| Destructor.
|
bool | wait (const char *kbuf, size_t ksiz, double sec=-1) |
| Wait for a signal.
|
bool | wait (const std::string &key, double sec=-1) |
| Wait for a signal by a key.
|
size_t | signal (const char *kbuf, size_t ksiz) |
| Send a wake-up signal to another thread waiting by a key.
|
size_t | signal (const std::string &key) |
| Send a wake-up signal to another thread waiting by a key.
|
size_t | broadcast (const char *kbuf, size_t ksiz) |
| Send wake-up signals to all threads waiting by a key.
|
size_t | broadcast (const std::string &key) |
| Send wake-up signals to all threads waiting by a key.
|
size_t | broadcast_all () |
| Send wake-up signals to all threads waiting by each key.
|
size_t | count () |
| Get the total number of threads waiting for signals.
|
Detailed Description
Assosiative condition variable.
Constructor & Destructor Documentation
kyotocabinet::CondMap::CondMap |
( |
| ) |
[explicit] |
kyotocabinet::CondMap::~CondMap |
( |
| ) |
|
Member Function Documentation
bool kyotocabinet::CondMap::wait |
( |
const char * |
kbuf, |
|
|
size_t |
ksiz, |
|
|
double |
sec = -1 |
|
) |
| |
Wait for a signal.
- Parameters:
-
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
sec | the interval of the suspension in seconds. If it is negative, no timeout is specified. |
- Returns:
- true on catched signal, or false on timeout.
bool kyotocabinet::CondMap::wait |
( |
const std::string & |
key, |
|
|
double |
sec = -1 |
|
) |
| |
Wait for a signal by a key.
- Parameters:
-
key | the key. |
sec | the interval of the suspension in seconds. If it is negative, no timeout is specified. |
- Returns:
- true on catched signal, or false on timeout.
size_t kyotocabinet::CondMap::signal |
( |
const char * |
kbuf, |
|
|
size_t |
ksiz |
|
) |
| |
Send a wake-up signal to another thread waiting by a key.
- Parameters:
-
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
- Returns:
- the number of threads waiting for the signal.
size_t kyotocabinet::CondMap::signal |
( |
const std::string & |
key | ) |
|
Send a wake-up signal to another thread waiting by a key.
- Parameters:
-
- Returns:
- the number of threads waiting for the signal.
size_t kyotocabinet::CondMap::broadcast |
( |
const char * |
kbuf, |
|
|
size_t |
ksiz |
|
) |
| |
Send wake-up signals to all threads waiting by a key.
- Parameters:
-
kbuf | the pointer to the key region. |
ksiz | the size of the key region. |
- Returns:
- the number of threads waiting for the signal.
size_t kyotocabinet::CondMap::broadcast |
( |
const std::string & |
key | ) |
|
Send wake-up signals to all threads waiting by a key.
- Parameters:
-
- Returns:
- the number of threads waiting for the signal.
size_t kyotocabinet::CondMap::broadcast_all |
( |
| ) |
|
Send wake-up signals to all threads waiting by each key.
- Returns:
- the number of threads waiting for the signal.
size_t kyotocabinet::CondMap::count |
( |
| ) |
|
Get the total number of threads waiting for signals.
- Returns:
- the total number of threads waiting for signals.