Kyoto Cabinet

- Main Page
- Namespaces
- Classes
- Files

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

Public Member Functions | Static Public Member Functions
kyotocabinet::Thread Class Reference

Threading device. More...

`#include <kcthread.h>`

List of all members.

## Public Member Functions

| Thread ()
| Default constructor.
virtual | ~Thread ()
| Destructor.
virtual void | run ()=0
| Perform the concrete process.
void | start ()
| Start the thread.
void | join ()
| Wait for the thread to finish.
void | detach ()
| Put the thread in the detached state.

## Static Public Member Functions

static void | exit ()
| Terminate the running thread.
static void | yield ()
| Yield the processor from the current thread.
static void | chill ()
| Chill the processor by suspending execution for a quick moment.
static bool | sleep (double sec)
| Suspend execution of the current thread.
static int64_t | hash ()
| Get the hash value of the current thread.

## Detailed Description

Threading device.

## Constructor & Destructor Documentation

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

Default constructor.

virtual kyotocabinet::Thread::~Thread | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual void kyotocabinet::Thread::run | ( |  | ) | `[pure virtual]`

Perform the concrete process.

void kyotocabinet::Thread::start | ( |  | ) |

Start the thread.

void kyotocabinet::Thread::join | ( |  | ) |

Wait for the thread to finish.

void kyotocabinet::Thread::detach | ( |  | ) |

Put the thread in the detached state.

static void kyotocabinet::Thread::exit | ( |  | ) | `[static]`

Terminate the running thread.

static void kyotocabinet::Thread::yield | ( |  | ) | `[static]`

Yield the processor from the current thread.

static void kyotocabinet::Thread::chill | ( |  | ) | `[static]`

Chill the processor by suspending execution for a quick moment.

static bool kyotocabinet::Thread::sleep | ( | double | sec | ) | `[static]`

Suspend execution of the current thread.

Parameters:

  sec | the interval of the suspension in seconds.

Returns:
  true on success, or false on failure.

static int64_t kyotocabinet::Thread::hash | ( |  | ) | `[static]`

Get the hash value of the current thread.

Returns:
  the hash value of the current thread.