diff options
| author | 2014-03-21 20:42:38 +0100 | |
|---|---|---|
| committer | 2014-03-21 20:42:38 +0100 | |
| commit | d95dfaacb04448230a4ab6a3fb152d96d13e959f (patch) | |
| tree | 467d0d179502b142418ad11d15ec972fa209abd2 | |
| parent | a406cfaa4724b3a78683b732f016c9ad33cad187 (diff) | |
| download | libimobiledevice-d95dfaacb04448230a4ab6a3fb152d96d13e959f.tar.gz libimobiledevice-d95dfaacb04448230a4ab6a3fb152d96d13e959f.tar.bz2 | |
common: add THREAD_ID macro
| -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); |
