20 #if !defined(THREAD_H) 29 #if defined(_WIN32) || defined(_WIN64) 31 #define thread_type HANDLE 32 #define thread_id_type DWORD 33 #define thread_return_type DWORD 34 #define thread_fn LPTHREAD_START_ROUTINE 35 #define cond_type HANDLE 36 #define sem_type HANDLE 38 #define ETIMEDOUT WSAETIMEDOUT 42 #define thread_type pthread_t 43 #define thread_id_type pthread_t 44 #define thread_return_type void* 49 #include <dispatch/dispatch.h> 50 typedef dispatch_semaphore_t
sem_type;
52 #include <semaphore.h> int Thread_post_sem(sem_type sem)
sem_type Thread_create_sem(int *)
static int cond(LexState *ls)
thread_return_type(* thread_fn)(void *)
LIBMQTT_API int Thread_unlock_mutex(mutex_type)
int Thread_wait_sem(sem_type sem, int timeout)
LIBMQTT_API thread_id_type Thread_getid()
int Thread_destroy_sem(sem_type sem)
cond_type Thread_create_cond(int *)
LIBMQTT_API int Thread_lock_mutex(mutex_type)
cond_type_struct * cond_type
#define thread_return_type
int Thread_destroy_cond(cond_type)
int Thread_signal_cond(cond_type)
int Thread_check_sem(sem_type sem)
LIBMQTT_API thread_type Thread_start(thread_fn, void *)
LIBMQTT_API mutex_type Thread_create_mutex(int *)
int Thread_wait_cond(cond_type condvar, int timeout)
int Thread_destroy_mutex(mutex_type)