21 #include "../../SDL_internal.h" 30 #if SDL_THREADS_DISABLED 47 return SDL_SetError(
"SDL not built with thread support");
53 return SDL_SetError(
"SDL not built with thread support");
59 return SDL_SetError(
"SDL not built with thread support");
71 return SDL_SetError(
"SDL not built with thread support");
94 sem->count = initial_value;
95 sem->waiters_count = 0;
99 if (!sem->count_lock || !sem->count_nonzero) {
114 sem->count = 0xFFFFFFFF;
115 while (sem->waiters_count > 0) {
120 if (sem->count_lock) {
140 if (sem->count > 0) {
164 ++sem->waiters_count;
168 sem->count_lock, timeout);
170 --sem->waiters_count;
207 if (sem->waiters_count > 0) {
int SDL_SemPost(SDL_sem *sem)
#define SDL_MUTEX_TIMEDOUT
#define SDL_MUTEX_MAXWAIT
#define SDL_CondWaitTimeout
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
int SDL_SemTryWait(SDL_sem *sem)
int SDL_SemWait(SDL_sem *sem)
GLsizei const GLfloat * value
#define SDL_OutOfMemory()
Uint32 SDL_SemValue(SDL_sem *sem)
GLbitfield GLuint64 timeout
void SDL_DestroySemaphore(SDL_sem *sem)
SDL_sem * SDL_CreateSemaphore(Uint32 initial_value)