BRL-CAD
tc.h File Reference
#include "common.h"
#include "bu/defines.h"
#include "bio.h"
Include dependency graph for tc.h:

Go to the source code of this file.

Macros

#define bu_thrd_error   0
 
#define bu_thrd_success   1
 
#define bu_thrd_timedout   2
 
#define bu_thrd_busy   3
 
#define bu_thrd_nomem   4
 

Typedefs

typedef int(* bu_thrd_start_t) (void *arg)
 
typedef pthread_t bu_thrd_t
 
typedef pthread_mutex_t bu_mtx_t
 
typedef pthread_cond_t bu_cnd_t
 

Functions

int bu_thrd_create (bu_thrd_t *thr, bu_thrd_start_t func, void *arg)
 
int bu_thrd_join (bu_thrd_t thr, int *res)
 
int bu_mtx_init (bu_mtx_t *mtx)
 
int bu_mtx_lock (bu_mtx_t *mtx)
 
int bu_mtx_unlock (bu_mtx_t *mtx)
 
void bu_mtx_destroy (bu_mtx_t *mtx)
 
int bu_cnd_init (bu_cnd_t *cond)
 
void bu_cnd_destroy (bu_cnd_t *cond)
 
int bu_cnd_wait (bu_cnd_t *cond, bu_mtx_t *mtx)
 
int bu_cnd_broadcast (bu_cnd_t *cond)
 
int bu_cnd_signal (bu_cnd_t *cond)
 
int bu_mtx_trylock (bu_mtx_t *mtx)
 

Macro Definition Documentation

◆ bu_thrd_error

#define bu_thrd_error   0

The requested operation failed

Definition at line 59 of file tc.h.

◆ bu_thrd_success

#define bu_thrd_success   1

The requested operation succeeded

Definition at line 60 of file tc.h.

◆ bu_thrd_timedout

#define bu_thrd_timedout   2

The time specified in the call was reached without acquiring the requested resource

Definition at line 61 of file tc.h.

◆ bu_thrd_busy

#define bu_thrd_busy   3

The requested operation failed because a tesource requested by a test and return function is already in use

Definition at line 62 of file tc.h.

◆ bu_thrd_nomem

#define bu_thrd_nomem   4

The requested operation failed because it was unable to allocate memory

Definition at line 63 of file tc.h.

Typedef Documentation

◆ bu_thrd_start_t

typedef int(* bu_thrd_start_t) (void *arg)

Definition at line 65 of file tc.h.

◆ bu_thrd_t

typedef pthread_t bu_thrd_t

Definition at line 69 of file tc.h.

◆ bu_mtx_t

typedef pthread_mutex_t bu_mtx_t

Definition at line 84 of file tc.h.

◆ bu_cnd_t

typedef pthread_cond_t bu_cnd_t

Definition at line 95 of file tc.h.

Function Documentation

◆ bu_thrd_create()

int bu_thrd_create ( bu_thrd_t thr,
bu_thrd_start_t  func,
void *  arg 
)

◆ bu_thrd_join()

int bu_thrd_join ( bu_thrd_t  thr,
int *  res 
)

◆ bu_mtx_init()

int bu_mtx_init ( bu_mtx_t mtx)

◆ bu_mtx_lock()

int bu_mtx_lock ( bu_mtx_t mtx)

◆ bu_mtx_unlock()

int bu_mtx_unlock ( bu_mtx_t mtx)

◆ bu_mtx_destroy()

void bu_mtx_destroy ( bu_mtx_t mtx)

◆ bu_cnd_init()

int bu_cnd_init ( bu_cnd_t cond)

◆ bu_cnd_destroy()

void bu_cnd_destroy ( bu_cnd_t cond)

◆ bu_cnd_wait()

int bu_cnd_wait ( bu_cnd_t cond,
bu_mtx_t mtx 
)

◆ bu_cnd_broadcast()

int bu_cnd_broadcast ( bu_cnd_t cond)

◆ bu_cnd_signal()

int bu_cnd_signal ( bu_cnd_t cond)

◆ bu_mtx_trylock()

int bu_mtx_trylock ( bu_mtx_t mtx)