diff options
Diffstat (limited to 'src/threading.h')
-rw-r--r-- | src/threading.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/threading.h b/src/threading.h index f4f1ada..b95733d 100644 --- a/src/threading.h +++ b/src/threading.h | |||
@@ -5,7 +5,10 @@ | |||
5 | #define __threading_h__ 1 | 5 | #define __threading_h__ 1 |
6 | 6 | ||
7 | /* Platform detection | 7 | /* Platform detection |
8 | */ | 8 | * win32-pthread: |
9 | * define HAVE_WIN32_PTHREAD and PTW32_INCLUDE_WINDOWS_H in your project configuration when building for win32-pthread. | ||
10 | * link against pthreadVC2.lib, and of course have pthreadVC2.dll somewhere in your path. | ||
11 | */ | ||
9 | #ifdef _WIN32_WCE | 12 | #ifdef _WIN32_WCE |
10 | #define PLATFORM_POCKETPC | 13 | #define PLATFORM_POCKETPC |
11 | #elif (defined _WIN32) | 14 | #elif (defined _WIN32) |
@@ -44,7 +47,7 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED }; | |||
44 | #define THREADAPI_WINDOWS 1 | 47 | #define THREADAPI_WINDOWS 1 |
45 | #define THREADAPI_PTHREAD 2 | 48 | #define THREADAPI_PTHREAD 2 |
46 | 49 | ||
47 | #if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) | 50 | #if( defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC)) && !defined( HAVE_WIN32_PTHREAD) |
48 | #define THREADAPI THREADAPI_WINDOWS | 51 | #define THREADAPI THREADAPI_WINDOWS |
49 | #else // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) | 52 | #else // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) |
50 | #define THREADAPI THREADAPI_PTHREAD | 53 | #define THREADAPI THREADAPI_PTHREAD |
@@ -114,8 +117,11 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED }; | |||
114 | // FreeBSD 6.2 has pthread_yield() | 117 | // FreeBSD 6.2 has pthread_yield() |
115 | // ... | 118 | // ... |
116 | // | 119 | // |
117 | #ifdef PLATFORM_OSX | 120 | #if defined( PLATFORM_OSX) |
118 | #define YIELD() pthread_yield_np() | 121 | #define YIELD() pthread_yield_np() |
122 | #elif defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC) | ||
123 | // for some reason win32-pthread doesn't have pthread_yield(), but sched_yield() | ||
124 | #define YIELD() sched_yield() | ||
119 | #else | 125 | #else |
120 | #define YIELD() pthread_yield() | 126 | #define YIELD() pthread_yield() |
121 | #endif | 127 | #endif |