diff src/thread/linux/SDL_syscond.c @ 244:dc660aee7d7d

Fixed timeout in Linux condition variable implementation
author Sam Lantinga <slouken@libsdl.org>
date Fri, 23 Nov 2001 17:11:05 +0000
parents 74212992fb08
children e8157fcb3114
line wrap: on
line diff
--- a/src/thread/linux/SDL_syscond.c	Thu Nov 22 06:34:25 2001 +0000
+++ b/src/thread/linux/SDL_syscond.c	Fri Nov 23 17:11:05 2001 +0000
@@ -137,10 +137,10 @@
 	gettimeofday(&delta, NULL);
 
 	abstime.tv_sec = delta.tv_sec + (ms/1000);
-	abstime.tv_nsec = (delta.tv_usec+(ms%1000)) * 1000;
-        if ( abstime.tv_nsec > 1000000 ) {
+	abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000;
+        if ( abstime.tv_nsec > 1000000000 ) {
           abstime.tv_sec += 1;
-          abstime.tv_nsec -= 1000000;
+          abstime.tv_nsec -= 1000000000;
         }
 
   tryagain: