DRAFT

SDL_SemPost

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

See Remarks.

Syntax

int SDL_SemPost(SDL_sem* sem)

Function Parameters

sem

the semaphore to increment

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().
*

Should the (not blocking) addendum from the header description be moved down here and explained more fully?


CategoryAPI, CategoryMutex

SDL_SemPost (last edited 2010-10-18 02:17:07 by SheenaSmith)

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