Skip to content

Commit

Permalink
Fixed timeout in Linux condition variable implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 23, 2001
1 parent 0f5e56a commit 224744d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/thread/linux/SDL_syscond.c
Expand Up @@ -137,10 +137,10 @@ int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
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:
Expand Down

0 comments on commit 224744d

Please sign in to comment.