1SDL_SemPost(3) SDL API Reference SDL_SemPost(3)
2
3
4
6 SDL_SemPost - Unlock a semaphore.
7
9 #include "SDL.h" #include "SDL_thread.h"
10
11 int SDL_SemPost(SDL_sem *sem);
12
14 SDL_SemPost unlocks the semaphore pointed to by sem and atomically
15 increments the semaphores value. Threads that were blocking on the sem‐
16 aphore may be scheduled after this call succeeds.
17
18 SDL_SemPost should be called after a semaphore is locked by a success‐
19 ful call to SDL_SemWait, SDL_SemTryWait or SDL_SemWaitTimeout.
20
22 Returns 0 if successful or -1 if there was an error (leaving the sema‐
23 phore unchanged).
24
26 SDL_SemPost(my_sem);
27
29 SDL_CreateSemaphore, SDL_DestroySemaphore, SDL_SemWait, SDL_SemTryWait,
30 SDL_SemWaitTimeout, SDL_SemValue
31
32
33
34SDL Tue 11 Sep 2001, 23:00 SDL_SemPost(3)