Skip to content

Commit

Permalink
switch: fix SDL_CondWaitTimeout (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste authored and WinterMute committed Jun 18, 2021
1 parent 45b864b commit 8629d3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/thread/switch/SDL_syscond.c
Expand Up @@ -138,8 +138,8 @@ SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
return SDL_SetError("SDL_CondWaitTimeout: passed a NULL cond/mutex");
}

ts.tv_sec = ms / 1000;
ts.tv_nsec = (ms % 1000) * 1000000;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_nsec += (long) (ms * 1E6);
res = cnd_timedwait(&cond->cnd, &mutex->mtx, &ts);
if (res != thrd_success) {
return SDL_SetError("SDL_CondWaitTimeout::cnd_timedwait failed: %i", res);
Expand Down

0 comments on commit 8629d3f

Please sign in to comment.