changeset 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 cf4944faad96
children ab781a7dd82f
files src/thread/linux/SDL_syscond.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
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: