Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512 Fixes https://github.com/libsdl-org/SDL/issues/6731
This commit is contained in:
parent
764b899a13
commit
8121bbd083
96 changed files with 938 additions and 1243 deletions
|
@ -481,4 +481,43 @@ void SDL_DetachThread(SDL_Thread *thread)
|
|||
}
|
||||
}
|
||||
|
||||
int SDL_SemWait(SDL_sem *sem)
|
||||
{
|
||||
return SDL_SemWaitTimeoutNS(sem, SDL_MUTEX_MAXWAIT);
|
||||
}
|
||||
|
||||
int SDL_SemTryWait(SDL_sem *sem)
|
||||
{
|
||||
return SDL_SemWaitTimeoutNS(sem, 0);
|
||||
}
|
||||
|
||||
int SDL_SemWaitTimeout(SDL_sem *sem, Sint32 timeoutMS)
|
||||
{
|
||||
Sint64 timeoutNS;
|
||||
|
||||
if (timeoutMS >= 0) {
|
||||
timeoutNS = SDL_MS_TO_NS(timeoutMS);
|
||||
} else {
|
||||
timeoutNS = -1;
|
||||
}
|
||||
return SDL_SemWaitTimeoutNS(sem, timeoutNS);
|
||||
}
|
||||
|
||||
int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
|
||||
{
|
||||
return SDL_CondWaitTimeoutNS(cond, mutex, SDL_MUTEX_MAXWAIT);
|
||||
}
|
||||
|
||||
int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Sint32 timeoutMS)
|
||||
{
|
||||
Sint64 timeoutNS;
|
||||
|
||||
if (timeoutMS >= 0) {
|
||||
timeoutNS = SDL_MS_TO_NS(timeoutMS);
|
||||
} else {
|
||||
timeoutNS = -1;
|
||||
}
|
||||
return SDL_CondWaitTimeoutNS(cond, mutex, timeoutNS);
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue