Kyoto Cabinet: kyotocabinet::SpinLock Class Reference

Kyoto Cabinet

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
kyotocabinet::SpinLock Class Reference

Lightweight mutual exclusion device. More...

`#include <kcthread.h>`

List of all members.

## Public Member Functions
| SpinLock ()
| Default constructor.
| ~SpinLock ()
| Destructor.
void | lock ()
| Get the lock.
bool | lock_try ()
| Try to get the lock.
void | unlock ()
| Release the lock.

## Detailed Description

Lightweight mutual exclusion device.

## Constructor & Destructor Documentation

kyotocabinet::SpinLock::SpinLock | ( |  | ) | `[explicit]`

Default constructor.

kyotocabinet::SpinLock::~SpinLock | ( |  | ) |

Destructor.

## Member Function Documentation

void kyotocabinet::SpinLock::lock | ( |  | ) |

Get the lock.

bool kyotocabinet::SpinLock::lock_try | ( |  | ) |

Try to get the lock.

Returns:
  true on success, or false on failure.

void kyotocabinet::SpinLock::unlock | ( |  | ) |

Release the lock.