4 >SDL_CreateMutex
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE=
"SDL Library Documentation"
11 HREF=
"index.html"><LINK
13 TITLE=
"Multi-threaded Programming"
14 HREF=
"thread.html"><LINK
16 TITLE=
"SDL_KillThread"
17 HREF=
"sdlkillthread.html"><LINK
19 TITLE=
"SDL_DestroyMutex"
20 HREF=
"sdldestroymutex.html"></HEAD
31 SUMMARY=
"Header navigation table"
40 >SDL Library Documentation
</TH
48 HREF=
"sdlkillthread.html"
62 HREF=
"sdldestroymutex.html"
83 >SDL_CreateMutex
--
Create a mutex
</DIV
85 CLASS=
"REFSYNOPSISDIV"
99 CLASS=
"FUNCSYNOPSISINFO"
101 #include
"SDL_thread.h"</PRE
124 >Create a new, unlocked mutex.
</P
134 CLASS=
"PROGRAMLISTING"
137 mut=SDL_CreateMutex();
140 if(SDL_mutexP(mut)==-
1){
141 fprintf(stderr,
"Couldn't lock mutex\n");
145 /* Do stuff while mutex is locked */
148 if(SDL_mutexV(mut)==-
1){
149 fprintf(stderr,
"Couldn't unlock mutex\n");
153 SDL_DestroyMutex(mut);
</PRE
164 HREF=
"sdlmutexp.html"
171 HREF=
"sdlmutexv.html"
178 HREF=
"sdldestroymutex.html"
181 >SDL_DestroyMutex
</TT
190 SUMMARY=
"Footer navigation table"
201 HREF=
"sdlkillthread.html"
219 HREF=
"sdldestroymutex.html"
243 >SDL_DestroyMutex
</TD