# kyotocabinet::SlottedSpinLock< SLOTNUM > Class Template Reference

Slotted spin lock devices. More...

`#include <kcthread.h>`

List of all members.

## Public Member Functions

| SlottedSpinLock ()
| Constructor.
| ~SlottedSpinLock ()
| Destructor.
void | lock (int32_t idx)
| Get the lock of a slot.
void | unlock (int32_t idx)
| Release the lock of a slot.
void | lock_all ()
| Get the locks of all slots.
void | unlock_all ()
| Release the locks of all slots.

## Detailed Description

### template<int32_t SLOTNUM>
class kyotocabinet::SlottedSpinLock< SLOTNUM >

Slotted spin lock devices.

Parameters:

  | SLOTNUM | the number of slots.

## Constructor & Destructor Documentation

template<int32_t SLOTNUM>

kyotocabinet::SlottedSpinLock< SLOTNUM >::SlottedSpinLock | ( |  | ) | `[explicit]`

Constructor.

template<int32_t SLOTNUM>

kyotocabinet::SlottedSpinLock< SLOTNUM >::~SlottedSpinLock | ( |  | ) |

Destructor.

## Member Function Documentation

template<int32_t SLOTNUM>

void kyotocabinet::SlottedSpinLock< SLOTNUM >::lock | ( | int32_t | idx | ) |

Get the lock of a slot.

Parameters:

  | idx | the index of a slot.

template<int32_t SLOTNUM>

void kyotocabinet::SlottedSpinLock< SLOTNUM >::unlock | ( | int32_t | idx | ) |

Release the lock of a slot.

Parameters:

  | idx | the index of a slot.

template<int32_t SLOTNUM>

void kyotocabinet::SlottedSpinLock< SLOTNUM >::lock_all | ( |  | ) |

Get the locks of all slots.

template<int32_t SLOTNUM>

void kyotocabinet::SlottedSpinLock< SLOTNUM >::unlock_all | ( |  | ) |

Release the locks of all slots.