29 #define MAX_THREAD_SPECIFIC_DATA 512 36 const char *str_text = "\033[1;33mWARNING\033[0m: unsupported pthread function called = "; \ 37 const char *str_func = __PRETTY_FUNCTION__; \ 38 const char *str_endl = "\n"; \ 39 write(0, str_text, strlen(str_text)); \ 40 write(0, str_func, strlen(str_func)); \ 41 write(0, str_endl, strlen(str_endl)); \ 44 #define ARG_UNSUPPORTED(a) \ 46 const char *str_text = "\033[1;33mWARNING\033[0m: " a " not supported for function called = "; \ 47 const char *str_func = __PRETTY_FUNCTION__; \ 48 const char *str_endl = "\n"; \ 49 write(0, str_text, strlen(str_text)); \ 50 write(0, str_func, strlen(str_func)); \ 51 write(0, str_endl, strlen(str_endl)); \ 54 #ifndef LOOKUP_TLS_DATA 64 __sync_lock_release(cond);
112 while (__sync_lock_test_and_set(cond, 1)) {
while (*cond); };
138 #ifdef LOOKUP_TLS_DATA 155 static int64_t g_keys = 0;
163 *key = __sync_fetch_and_add(&g_keys, 1);
201 while (__sync_lock_test_and_set(mutex, 1)) {
while (*mutex); };
219 __sync_lock_release(mutex);
251 if (__sync_fetch_and_add(once, 1) == 0)
270 #ifdef LOOKUP_TLS_DATA int pthread_equal(pthread_t, pthread_t)
int pthread_cond_destroy(pthread_cond_t *)
void * pthread_getspecific(pthread_key_t key)
int pthread_cond_broadcast(pthread_cond_t *cond)
int pthread_cond_signal(pthread_cond_t *)
uint64_t thread_context_cpuid(void)
int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
int pthread_mutexattr_init(pthread_mutexattr_t *)
int pthread_mutex_trylock(pthread_mutex_t *)
int64_t unsigned long void * data
pthread_t pthread_self(void)
int pthread_mutex_unlock(pthread_mutex_t *mutex)
int pthread_mutex_destroy(pthread_mutex_t *)
int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, const struct timespec *)
#define MAX_THREAD_SPECIFIC_DATA
int pthread_detach(pthread_t)
int pthread_mutexattr_settype(pthread_mutexattr_t *, int)
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
int pthread_once(pthread_once_t *once, void(*init)(void))
int pthread_key_create(pthread_key_t *key, void(*destructor)(void *))
int pthread_key_delete(pthread_key_t)
int pthread_mutex_lock(pthread_mutex_t *mutex)
int pthread_setspecific(pthread_key_t key, const void *data)
#define ARG_UNSUPPORTED(a)
int pthread_mutexattr_destroy(pthread_mutexattr_t *)
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
uint64_t thread_context_tlsptr(void)
void * threadSpecificData[MAX_THREAD_SPECIFIC_DATA]
int pthread_join(pthread_t, void **)