Macros | Functions | Variables
pthread.cpp File Reference

Go to the source code of this file.

Macros

#define MAX_THREAD_SPECIFIC_DATA   512
 
#define UNHANDLED()
 
#define ARG_UNSUPPORTED(a)
 

Functions

uint64_t thread_context_cpuid (void)
 
uint64_t thread_context_tlsptr (void)
 
int pthread_cond_broadcast (pthread_cond_t *cond)
 
int pthread_cond_destroy (pthread_cond_t *)
 
int pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *attr)
 
int pthread_cond_signal (pthread_cond_t *)
 
int pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, const struct timespec *)
 
int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
 
int pthread_detach (pthread_t)
 
int pthread_equal (pthread_t, pthread_t)
 
void * pthread_getspecific (pthread_key_t key)
 
int pthread_join (pthread_t, void **)
 
int pthread_key_create (pthread_key_t *key, void(*destructor)(void *))
 
int pthread_key_delete (pthread_key_t)
 
int pthread_mutex_destroy (pthread_mutex_t *)
 
int pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
 
int pthread_mutex_lock (pthread_mutex_t *mutex)
 
int pthread_mutex_trylock (pthread_mutex_t *)
 
int pthread_mutex_unlock (pthread_mutex_t *mutex)
 
int pthread_mutexattr_destroy (pthread_mutexattr_t *)
 
int pthread_mutexattr_init (pthread_mutexattr_t *)
 
int pthread_mutexattr_settype (pthread_mutexattr_t *, int)
 
int pthread_once (pthread_once_t *once, void(*init)(void))
 
pthread_t pthread_self (void)
 
int pthread_setspecific (pthread_key_t key, const void *data)
 

Variables

void * threadSpecificData [MAX_THREAD_SPECIFIC_DATA] = {0}
 

Macro Definition Documentation

◆ MAX_THREAD_SPECIFIC_DATA

#define MAX_THREAD_SPECIFIC_DATA   512

Definition at line 29 of file pthread.cpp.

◆ UNHANDLED

#define UNHANDLED ( )
Value:
{ \
const char *str_text = "\033[1;33mWARNING\033[0m: unsupported pthread function called = "; \
const char *str_func = __PRETTY_FUNCTION__; \
const char *str_endl = "\n"; \
write(0, str_text, strlen(str_text)); \
write(0, str_func, strlen(str_func)); \
write(0, str_endl, strlen(str_endl)); \
}

Definition at line 34 of file pthread.cpp.

◆ ARG_UNSUPPORTED

#define ARG_UNSUPPORTED (   a)
Value:
{ \
const char *str_text = "\033[1;33mWARNING\033[0m: " a " not supported for function called = "; \
const char *str_func = __PRETTY_FUNCTION__; \
const char *str_endl = "\n"; \
write(0, str_text, strlen(str_text)); \
write(0, str_func, strlen(str_func)); \
write(0, str_endl, strlen(str_endl)); \
}

Definition at line 44 of file pthread.cpp.

Function Documentation

◆ thread_context_cpuid()

uint64_t thread_context_cpuid ( void  )

◆ thread_context_tlsptr()

uint64_t thread_context_tlsptr ( void  )

◆ pthread_cond_broadcast()

int pthread_cond_broadcast ( pthread_cond_t *  cond)

Definition at line 59 of file pthread.cpp.

◆ pthread_cond_destroy()

int pthread_cond_destroy ( pthread_cond_t *  )

Definition at line 70 of file pthread.cpp.

◆ pthread_cond_init()

int pthread_cond_init ( pthread_cond_t *  cond,
const pthread_condattr_t *  attr 
)

Definition at line 77 of file pthread.cpp.

◆ pthread_cond_signal()

int pthread_cond_signal ( pthread_cond_t *  )

Definition at line 90 of file pthread.cpp.

◆ pthread_cond_timedwait()

int pthread_cond_timedwait ( pthread_cond_t *  ,
pthread_mutex_t *  ,
const struct timespec *   
)

Definition at line 97 of file pthread.cpp.

◆ pthread_cond_wait()

int pthread_cond_wait ( pthread_cond_t *  cond,
pthread_mutex_t *  mutex 
)

Definition at line 104 of file pthread.cpp.

◆ pthread_detach()

int pthread_detach ( pthread_t  )

Definition at line 119 of file pthread.cpp.

◆ pthread_equal()

int pthread_equal ( pthread_t  ,
pthread_t   
)

Definition at line 126 of file pthread.cpp.

◆ pthread_getspecific()

void* pthread_getspecific ( pthread_key_t  key)

Definition at line 133 of file pthread.cpp.

◆ pthread_join()

int pthread_join ( pthread_t  ,
void **   
)

Definition at line 146 of file pthread.cpp.

◆ pthread_key_create()

int pthread_key_create ( pthread_key_t *  key,
void(*)(void *)  destructor 
)

Definition at line 153 of file pthread.cpp.

◆ pthread_key_delete()

int pthread_key_delete ( pthread_key_t  )

Definition at line 169 of file pthread.cpp.

◆ pthread_mutex_destroy()

int pthread_mutex_destroy ( pthread_mutex_t *  )

Definition at line 176 of file pthread.cpp.

◆ pthread_mutex_init()

int pthread_mutex_init ( pthread_mutex_t *  mutex,
const pthread_mutexattr_t *  attr 
)

Definition at line 183 of file pthread.cpp.

◆ pthread_mutex_lock()

int pthread_mutex_lock ( pthread_mutex_t *  mutex)

Definition at line 196 of file pthread.cpp.

◆ pthread_mutex_trylock()

int pthread_mutex_trylock ( pthread_mutex_t *  )

Definition at line 207 of file pthread.cpp.

◆ pthread_mutex_unlock()

int pthread_mutex_unlock ( pthread_mutex_t *  mutex)

Definition at line 214 of file pthread.cpp.

◆ pthread_mutexattr_destroy()

int pthread_mutexattr_destroy ( pthread_mutexattr_t *  )

Definition at line 225 of file pthread.cpp.

◆ pthread_mutexattr_init()

int pthread_mutexattr_init ( pthread_mutexattr_t *  )

Definition at line 232 of file pthread.cpp.

◆ pthread_mutexattr_settype()

int pthread_mutexattr_settype ( pthread_mutexattr_t *  ,
int   
)

Definition at line 239 of file pthread.cpp.

◆ pthread_once()

int pthread_once ( pthread_once_t *  once,
void(*)(void)  init 
)

Definition at line 246 of file pthread.cpp.

◆ pthread_self()

pthread_t pthread_self ( void  )

Definition at line 258 of file pthread.cpp.

◆ pthread_setspecific()

int pthread_setspecific ( pthread_key_t  key,
const void *  data 
)

Definition at line 265 of file pthread.cpp.

Variable Documentation

◆ threadSpecificData

void* threadSpecificData[MAX_THREAD_SPECIFIC_DATA] = {0}

Definition at line 55 of file pthread.cpp.