From 64a9364ac2b69066c2248816174ef22cb77cdf48 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 27 Sep 2005 11:27:38 +0000 Subject: [PATCH] Date: Sat, 17 Sep 2005 13:38:49 +0200 From: Jon Daniel To: sdl@libsdl.org Subject: [SDL] SDL_SemWaitTimeout patch for BeOS The current SDL-1.2.9/src/thread/beos/SDL_syssem.c returns -1 if the acquire_sem timeouts which according to the DocWiki is not correct. I've added support for the B_TIMED_OUT and B_WOULD_BLOCK in the switch. Jon Daniel --- src/thread/beos/SDL_syssem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/thread/beos/SDL_syssem.c b/src/thread/beos/SDL_syssem.c index bab28c073..b57bee90b 100644 --- a/src/thread/beos/SDL_syssem.c +++ b/src/thread/beos/SDL_syssem.c @@ -90,6 +90,12 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) case B_NO_ERROR: retval = 0; break; + case B_TIMED_OUT: + retval = SDL_MUTEX_TIMEDOUT; + break; + case B_WOULD_BLOCK: + retval = SDL_MUTEX_TIMEDOUT; + break; default: SDL_SetError("acquire_sem() failed"); retval = -1;