Zero  0.1.0
Classes | Functions | Variables
kits_thread.cpp File Reference
#include "kits_thread.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>

Classes

struct  thread_args
 
class  root_thread_t
 

Functions

void thread_destroy (void *thread_object)
 
void * start_thread (void *)
 
static void setup_thread (thread_args *args)
 
void thread_init (void)
 Initialize thread module. More...
 
thread_tthread_get_self (void)
 
pthread_t thread_create (thread_t *t, thread_pool *pool)
 
pthread_mutex_t thread_mutex_create (const pthread_mutexattr_t *attr)
 
void thread_mutex_lock (pthread_mutex_t &mutex)
 
void thread_mutex_unlock (pthread_mutex_t &mutex)
 
void thread_mutex_destroy (pthread_mutex_t &mutex)
 
pthread_cond_t thread_cond_create (const pthread_condattr_t *attr)
 
void thread_cond_destroy (pthread_cond_t &cond)
 
void thread_cond_signal (pthread_cond_t &cond)
 
void thread_cond_broadcast (pthread_cond_t &cond)
 
void thread_cond_wait (pthread_cond_t &cond, pthread_mutex_t &mutex)
 
bool thread_cond_wait (pthread_cond_t &cond, pthread_mutex_t &mutex, struct timespec &timeout)
 
bool thread_cond_wait (pthread_cond_t &cond, pthread_mutex_t &mutex, int timeout_ms)
 

Variables

static __thread thread_tTHREAD_KEY_SELF
 
__thread thread_poolTHREAD_POOL
 
static thread_pool default_thread_pool (1<< 30)
 

Function Documentation

§ setup_thread()

static void setup_thread ( thread_args args)
static

§ start_thread()

void * start_thread ( void *  thread_object)

§ thread_cond_broadcast()

void thread_cond_broadcast ( pthread_cond_t &  cond)

§ thread_cond_create()

pthread_cond_t thread_cond_create ( const pthread_condattr_t *  attr)

§ thread_cond_destroy()

void thread_cond_destroy ( pthread_cond_t &  cond)

§ thread_cond_signal()

void thread_cond_signal ( pthread_cond_t &  cond)

§ thread_cond_wait() [1/3]

void thread_cond_wait ( pthread_cond_t &  cond,
pthread_mutex_t &  mutex 
)

§ thread_cond_wait() [2/3]

bool thread_cond_wait ( pthread_cond_t &  cond,
pthread_mutex_t &  mutex,
struct timespec &  timeout 
)

§ thread_cond_wait() [3/3]

bool thread_cond_wait ( pthread_cond_t &  cond,
pthread_mutex_t &  mutex,
int  timeout_ms 
)

§ thread_create()

pthread_t thread_create ( thread_t t,
thread_pool pool 
)

§ thread_destroy()

void thread_destroy ( void *  thread_object)

§ thread_get_self()

thread_t* thread_get_self ( void  )

§ thread_init()

void thread_init ( void  )

Initialize thread module.

Returns
void

§ thread_mutex_create()

pthread_mutex_t thread_mutex_create ( const pthread_mutexattr_t *  attr)

§ thread_mutex_destroy()

void thread_mutex_destroy ( pthread_mutex_t &  mutex)

§ thread_mutex_lock()

void thread_mutex_lock ( pthread_mutex_t &  mutex)

§ thread_mutex_unlock()

void thread_mutex_unlock ( pthread_mutex_t &  mutex)

Variable Documentation

§ default_thread_pool

thread_pool default_thread_pool(1<< 30)
static

§ THREAD_KEY_SELF

__thread thread_t* THREAD_KEY_SELF
static

§ THREAD_POOL

__thread thread_pool* THREAD_POOL