diff options
Diffstat (limited to 'src/threading.c')
-rw-r--r-- | src/threading.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/threading.c b/src/threading.c index 0a07d47..4e3d8f6 100644 --- a/src/threading.c +++ b/src/threading.c | |||
@@ -74,7 +74,9 @@ THE SOFTWARE. | |||
74 | #if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) | 74 | #if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) |
75 | static void FAIL( const char *funcname, int rc ) { | 75 | static void FAIL( const char *funcname, int rc ) { |
76 | fprintf( stderr, "%s() failed! (%d)\n", funcname, rc ); | 76 | fprintf( stderr, "%s() failed! (%d)\n", funcname, rc ); |
77 | #ifdef _MSC_VER | ||
77 | __debugbreak(); // give a chance to the debugger! | 78 | __debugbreak(); // give a chance to the debugger! |
79 | #endif // _MSC_VER | ||
78 | abort(); | 80 | abort(); |
79 | } | 81 | } |
80 | #endif | 82 | #endif |
@@ -281,9 +283,9 @@ static void prepare_timeout( struct timespec *ts, time_d abs_secs ) { | |||
281 | } | 283 | } |
282 | // | 284 | // |
283 | bool_t THREAD_WAIT( THREAD_T *ref, double secs ) { | 285 | bool_t THREAD_WAIT( THREAD_T *ref, double secs ) { |
284 | long ms= (long)((secs*1000.0)+0.5); | 286 | DWORD ms = (secs<0.0) ? INFINITE : (DWORD)((secs*1000.0)+0.5); |
285 | 287 | ||
286 | DWORD rc= WaitForSingleObject( *ref, ms<0 ? INFINITE:ms /*timeout*/ ); | 288 | DWORD rc= WaitForSingleObject( *ref, ms /*timeout*/ ); |
287 | // | 289 | // |
288 | // (WAIT_ABANDONED) | 290 | // (WAIT_ABANDONED) |
289 | // WAIT_OBJECT_0 success (0) | 291 | // WAIT_OBJECT_0 success (0) |