Kyoto Cabinet
|
Basic mutual exclusion device. More...
#include <kcthread.h>
Public Types | |
enum | Type { FAST, ERRORCHECK, RECURSIVE } |
Type of the behavior for double locking. More... | |
Public Member Functions | |
Mutex () | |
Default constructor. | |
Mutex (Type type) | |
Constructor. | |
~Mutex () | |
Destructor. | |
void | lock () |
Get the lock. | |
bool | lock_try () |
Try to get the lock. | |
bool | lock_try (double sec) |
Try to get the lock. | |
void | unlock () |
Release the lock. | |
Friends | |
class | CondVar |
Basic mutual exclusion device.
kyotocabinet::Mutex::Mutex | ( | ) | [explicit] |
Default constructor.
kyotocabinet::Mutex::Mutex | ( | Type | type | ) | [explicit] |
Constructor.
type | the behavior for double locking. |
Destructor.
void kyotocabinet::Mutex::lock | ( | ) |
Get the lock.
bool kyotocabinet::Mutex::lock_try | ( | ) |
Try to get the lock.
bool kyotocabinet::Mutex::lock_try | ( | double | sec | ) |
Try to get the lock.
sec | the interval of the suspension in seconds. |
void kyotocabinet::Mutex::unlock | ( | ) |
Release the lock.