Wiki Page Content

Revision 4 as of 2010-09-09 20:38:12

Clear message

DRAFT

SDL_SemPost

Use this function to *unlock a semaphore and* atomically increase the semaphore's count (not blocking).

green

Syntax

int SDL_SemPost(SDL_sem* sem)

Function Parameters

sem

a pointer to the SDL_sem structure / semaphore to be incremented

Return Value

Returns 0 on success (and increments the semaphore count) or a negative error code on failure *(leaving the semaphore unchanged)*; call SDL_GetError() for more information.

Code Examples

*

SDL_SemPost(my_sem);

*

Remarks

*
SDL_SemPost() unlocks the semaphore pointed to by sem and atomically increments the semaphore's value. Threads that were blocking on the semaphore may be scheduled after this call succeeds.

SDL_SemPost() should be called after a semaphore is locked by a successful call to SDL_SemWait(), SDL_SemTryWait() or SDL_SemWaitTimeout().
*

green


CategoryAPI, CategoryMutex

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit