SDL_!SemWait
NAME SYNOPSIS DESCRIPTION RETURN VALUE EXAMPLES SEE ALSO
SDL_!SemWait- Lock a semaphore and suspend the thread if the semaphore value is zero.
#include
int SDL_!SemWait(SDL_sem *sem);
SDL_!SemWait() suspends the calling thread until either the semaphore pointed to by sem has a positive value, the call is interrupted by a signal or error. If the call is successful it will atomically decrement the semaphore value.
After SDL_!SemWait() is successful, the semaphore can be released and its count atomically incremented by a successful call to SDL_!SemPost.
Returns 0 if successful or -1 if there was an error (leaving the semaphore unchanged).
if (SDL_!SemWait(my_sem) == -1) { return WAIT_FAILED; } ... SDL_!SemPost(my_sem);
SDL_!CreateSemaphore, SDL_!DestroySemaphore, SDL_!SemTryWait, SDL_!SemWaitTimeout, SDL_!SemPost, SDL_!SemValue
One page links to SDL_SemWait(3):