mirror of https://github.com/encounter/SDL.git
Switch sdl2 syscond fix (#28)
* switch: return SDL_MUTEX_TIMEDOUT when SDL_CondWaitTimeout... timeout
This commit is contained in:
parent
8629d3ff0b
commit
c465ab9b4d
|
@ -141,7 +141,9 @@ SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
|
|||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
ts.tv_nsec += (long) (ms * 1E6);
|
||||
res = cnd_timedwait(&cond->cnd, &mutex->mtx, &ts);
|
||||
if (res != thrd_success) {
|
||||
if (res == thrd_timedout) {
|
||||
return SDL_MUTEX_TIMEDOUT;
|
||||
} else if (res != thrd_success) {
|
||||
return SDL_SetError("SDL_CondWaitTimeout::cnd_timedwait failed: %i", res);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue