Wiki Page Content

Differences between revisions 3 and 4
Revision 3 as of 2010-09-08 23:31:40
Size: 1443
Editor: SheenaSmith
Comment: update content (old wiki)
Revision 4 as of 2010-09-09 20:38:12
Size: 1449
Editor: SheenaSmith
Comment: minor change
Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:
*
Line 27: Line 28:
*

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

None: SDL_SemPost (last edited 2013-08-12 05:48:11 by Sam Lantinga)

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