Go to the documentation of this file.
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;
170 --
sem->waiters_count;
207 if (
sem->waiters_count > 0) {
int SDL_SemTryWait(SDL_sem *sem)
GLbitfield GLuint64 timeout
SDL_sem * SDL_CreateSemaphore(Uint32 initial_value)
int SDL_SemWait(SDL_sem *sem)
#define SDL_MUTEX_TIMEDOUT
#define SDL_CondWaitTimeout
#define SDL_MUTEX_MAXWAIT
int SDL_SemPost(SDL_sem *sem)
Uint32 SDL_SemValue(SDL_sem *sem)
#define SDL_OutOfMemory()
GLsizei const GLfloat * value
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
void SDL_DestroySemaphore(SDL_sem *sem)