Wiki Page Content

Differences between revisions 4 and 6 (spanning 2 versions)
Revision 4 as of 2010-09-09 20:38:12
Size: 1449
Editor: SheenaSmith
Comment: minor change
Revision 6 as of 2010-10-18 02:17:07
Size: 1411
Editor: SheenaSmith
Comment: update content - pointers, structs
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
||'''sem'''||^a pointer to the SDL_sem structure / semaphore to be incremented^|| ||'''sem'''||^the semaphore to increment^||

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

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

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