fix thread macro in Linux
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define HGL_POSIX_THREAD_INCLUDE
|
||||
|
||||
#include<pthread.h>
|
||||
#include<semaphore.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include<dispatch/dispatch.h>
|
||||
@@ -12,19 +13,19 @@ namespace hgl
|
||||
using thread_mutex_ptr =pthread_mutex_t;
|
||||
|
||||
using thread_ptr =pthread_t;
|
||||
using rwlock_ptr =pthread_rwlock_t *;
|
||||
using rwlock_ptr =pthread_rwlock_t;
|
||||
|
||||
#ifdef __APPLE__
|
||||
using semaphore_ptr =dispatch_semaphore_t *;
|
||||
#else
|
||||
using semaphore_ptr =sem_t *;
|
||||
using semaphore_ptr =sem_t;
|
||||
#endif//
|
||||
|
||||
using cond_var_ptr =pthread_cond_t *;
|
||||
using cond_var_ptr =pthread_cond_t;
|
||||
|
||||
#define THREAD_FUNC void *
|
||||
#define HGL_THREAD_DETACH_SELF pthread_detach(pthread_self());
|
||||
|
||||
using proc_mutex_ptr =sem_t *;
|
||||
using proc_mutex_ptr =sem_t;
|
||||
}//namespace hgl
|
||||
#endif//HGL_POSIX_THREAD_INCLUDE
|
||||
|
Reference in New Issue
Block a user