Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2010-09-23 19:16:14
Size: 1218
Editor: SheenaSmith
Comment: minor change
Revision 6 as of 2010-10-18 02:10:48
Size: 1178
Editor: SheenaSmith
Comment: update content - pointers, structs
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
Returns ^a pointer to an SDL_mutex structure to be initialized in an unlocked state.^ Returns ^the initialized and unlocked mutex.^

DRAFT

SDL_CreateMutex

Use this function to create a mutex, initialized unlocked *...create a new, unlocked mutex* create and initialize an unlocked mutex.

Syntax

SDL_mutex* SDL_CreateMutex(void)

Return Value

Returns the initialized and unlocked mutex.

green

Code Examples

*

SDL_mutex *mut;

mut=SDL_CreateMutex();
.
.
if(SDL_mutexP(mut)==-1){
  fprintf(stderr, "Couldn't lock mutex\n");
  exit(-1);
}
.
/* Do stuff while mutex is locked */
.
.
if(SDL_mutexV(mut)==-1){
  fprintf(stderr, "Couldn't unlock mutex\n");
  exit(-1);
}

SDL_DestroyMutex(mut);

*
green

Remarks

You can add useful comments here


CategoryAPI, CategoryMutex

None: SDL_CreateMutex (last edited 2015-08-21 21:22:59 by PhilippWiesemann)

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