mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 06:45:59 +00:00
@@ -472,7 +472,7 @@ void SDL_DetachThread(SDL_Thread *thread)
|
||||
|
||||
int SDL_WaitSemaphore(SDL_Semaphore *sem)
|
||||
{
|
||||
return SDL_WaitSemaphoreTimeoutNS(sem, SDL_MUTEX_MAXWAIT);
|
||||
return SDL_WaitSemaphoreTimeoutNS(sem, -1);
|
||||
}
|
||||
|
||||
int SDL_TryWaitSemaphore(SDL_Semaphore *sem)
|
||||
@@ -494,7 +494,7 @@ int SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS)
|
||||
|
||||
int SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex)
|
||||
{
|
||||
return SDL_WaitConditionTimeoutNS(cond, mutex, SDL_MUTEX_MAXWAIT);
|
||||
return SDL_WaitConditionTimeoutNS(cond, mutex, -1);
|
||||
}
|
||||
|
||||
int SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS)
|
||||
|
@@ -67,7 +67,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
return SDL_InvalidParamError("sem");
|
||||
}
|
||||
|
||||
if (timeoutNS == SDL_MUTEX_MAXWAIT) {
|
||||
if (timeoutNS == -1) { // -1 == wait indefinitely.
|
||||
LightSemaphore_Acquire(&sem->semaphore, 1);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
return SDL_MUTEX_TIMEOUT;
|
||||
}
|
||||
|
||||
if (timeoutNS == SDL_MUTEX_MAXWAIT) {
|
||||
if (timeoutNS == -1) { // -1 == wait indefinitely.
|
||||
WaitAll(sem);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (timeoutNS != SDL_MUTEX_MAXWAIT) {
|
||||
if (timeoutNS != -1) { // -1 == wait indefinitely.
|
||||
SetTimerAlarm(&alarm, MSec2TimerBusClock(SDL_NS_TO_MS(timeoutNS)), &usercb, (void *)GetThreadId());
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
}
|
||||
|
||||
/* TODO: This routine is a bit overloaded.
|
||||
* If the timeout is 0 then just poll the semaphore; if it's SDL_MUTEX_MAXWAIT, pass
|
||||
* If the timeout is 0 then just poll the semaphore; if it's -1, pass
|
||||
* NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout
|
||||
* is specified, convert it to microseconds. */
|
||||
int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
|
@@ -71,7 +71,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
}
|
||||
|
||||
/* TODO: This routine is a bit overloaded.
|
||||
* If the timeout is 0 then just poll the semaphore; if it's SDL_MUTEX_MAXWAIT, pass
|
||||
* If the timeout is 0 then just poll the semaphore; if it's -1, pass
|
||||
* NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout
|
||||
* is specified, convert it to microseconds. */
|
||||
int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
|
Reference in New Issue
Block a user