Typedefs | Functions

threadsafe.h File Reference

#include "common/common.h"
#include "smart_mutex.h"
Include dependency graph for threadsafe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef qword_t thread_id_t
 Here we provide general methods to manage threads.
typedef void *(* thread_start_fn_t )(IN void *context)

Functions

int createThread (IN thread_start_fn_t start_fn, IN void *context, OUT thread_id_t &threadId)
thread_id_t getCurrentThreadId (void)
void sleepMilliseconds (IN long milliseconds)
 implement a cross-platform sleep method

Typedef Documentation

typedef qword_t thread_id_t

Here we provide general methods to manage threads.

These will use either pthreads or win32 threading APIs under the covers.

Definition at line 49 of file threadsafe.h.

typedef void*(* thread_start_fn_t)(IN void *context)

Definition at line 51 of file threadsafe.h.


Function Documentation

int createThread ( IN thread_start_fn_t  start_fn,
IN void *  context,
OUT thread_id_t threadId 
)

Definition at line 91 of file threadsafe.cpp.

thread_id_t getCurrentThreadId ( void   ) 

Definition at line 140 of file threadsafe.cpp.

void sleepMilliseconds ( IN long  milliseconds  ) 

implement a cross-platform sleep method

Definition at line 155 of file threadsafe.cpp.