Commit ff06c785 authored by Sam Lantinga's avatar Sam Lantinga

Fixed timeout in Linux condition variable implementation

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40245
parent c374bc5b
...@@ -137,10 +137,10 @@ int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) ...@@ -137,10 +137,10 @@ int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
gettimeofday(&delta, NULL); gettimeofday(&delta, NULL);
abstime.tv_sec = delta.tv_sec + (ms/1000); abstime.tv_sec = delta.tv_sec + (ms/1000);
abstime.tv_nsec = (delta.tv_usec+(ms%1000)) * 1000; abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000;
if ( abstime.tv_nsec > 1000000 ) { if ( abstime.tv_nsec > 1000000000 ) {
abstime.tv_sec += 1; abstime.tv_sec += 1;
abstime.tv_nsec -= 1000000; abstime.tv_nsec -= 1000000000;
} }
tryagain: tryagain:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment