diff options
| -rw-r--r-- | common/thread.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/thread.h b/common/thread.h index 5d20083..9b15cc4 100644 --- a/common/thread.h +++ b/common/thread.h | |||
| @@ -31,12 +31,14 @@ typedef volatile struct { | |||
| 31 | int state; | 31 | int state; |
| 32 | } thread_once_t; | 32 | } thread_once_t; |
| 33 | #define THREAD_ONCE_INIT {0, 0} | 33 | #define THREAD_ONCE_INIT {0, 0} |
| 34 | #define THREAD_ID GetCurrentThreadId() | ||
| 34 | #else | 35 | #else |
| 35 | #include <pthread.h> | 36 | #include <pthread.h> |
| 36 | typedef pthread_t thread_t; | 37 | typedef pthread_t thread_t; |
| 37 | typedef pthread_mutex_t mutex_t; | 38 | typedef pthread_mutex_t mutex_t; |
| 38 | typedef pthread_once_t thread_once_t; | 39 | typedef pthread_once_t thread_once_t; |
| 39 | #define THREAD_ONCE_INIT PTHREAD_ONCE_INIT | 40 | #define THREAD_ONCE_INIT PTHREAD_ONCE_INIT |
| 41 | #define THREAD_ID pthread_self() | ||
| 40 | #endif | 42 | #endif |
| 41 | 43 | ||
| 42 | typedef void* (*thread_func_t)(void* data); | 44 | typedef void* (*thread_func_t)(void* data); |
