comparison docs/html/thread.html @ 803:355632dca928

Updated SDL HTML documentation
author Sam Lantinga <slouken@libsdl.org>
date Tue, 10 Feb 2004 15:15:40 +0000
parents e5bc29de3f0a
children f12379c41042
comparison
equal deleted inserted replaced
802:3c609d54f100 803:355632dca928
2 ><HEAD 2 ><HEAD
3 ><TITLE 3 ><TITLE
4 >Multi-threaded Programming</TITLE 4 >Multi-threaded Programming</TITLE
5 ><META 5 ><META
6 NAME="GENERATOR" 6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64 7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
8 "><LINK 8 "><LINK
9 REL="HOME" 9 REL="HOME"
10 TITLE="SDL Library Documentation" 10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK 11 HREF="index.html"><LINK
12 REL="UP" 12 REL="UP"
30 VLINK="#551a8b" 30 VLINK="#551a8b"
31 ALINK="#ff0000" 31 ALINK="#ff0000"
32 ><DIV 32 ><DIV
33 CLASS="NAVHEADER" 33 CLASS="NAVHEADER"
34 ><TABLE 34 ><TABLE
35 SUMMARY="Header navigation table"
35 WIDTH="100%" 36 WIDTH="100%"
36 BORDER="0" 37 BORDER="0"
37 CELLPADDING="0" 38 CELLPADDING="0"
38 CELLSPACING="0" 39 CELLSPACING="0"
39 ><TR 40 ><TR
47 WIDTH="10%" 48 WIDTH="10%"
48 ALIGN="left" 49 ALIGN="left"
49 VALIGN="bottom" 50 VALIGN="bottom"
50 ><A 51 ><A
51 HREF="sdlcdtrack.html" 52 HREF="sdlcdtrack.html"
53 ACCESSKEY="P"
52 >Prev</A 54 >Prev</A
53 ></TD 55 ></TD
54 ><TD 56 ><TD
55 WIDTH="80%" 57 WIDTH="80%"
56 ALIGN="center" 58 ALIGN="center"
60 WIDTH="10%" 62 WIDTH="10%"
61 ALIGN="right" 63 ALIGN="right"
62 VALIGN="bottom" 64 VALIGN="bottom"
63 ><A 65 ><A
64 HREF="sdlcreatethread.html" 66 HREF="sdlcreatethread.html"
67 ACCESSKEY="N"
65 >Next</A 68 >Next</A
66 ></TD 69 ></TD
67 ></TR 70 ></TR
68 ></TABLE 71 ></TABLE
69 ><HR 72 ><HR
72 ><DIV 75 ><DIV
73 CLASS="CHAPTER" 76 CLASS="CHAPTER"
74 ><H1 77 ><H1
75 ><A 78 ><A
76 NAME="THREAD" 79 NAME="THREAD"
77 >Chapter 12. Multi-threaded Programming</A 80 ></A
78 ></H1 81 >Chapter 12. Multi-threaded Programming</H1
79 ><DIV 82 ><DIV
80 CLASS="TOC" 83 CLASS="TOC"
81 ><DL 84 ><DL
82 ><DT 85 ><DT
83 ><B 86 ><B
85 ></DT 88 ></DT
86 ><DT 89 ><DT
87 ><A 90 ><A
88 HREF="sdlcreatethread.html" 91 HREF="sdlcreatethread.html"
89 >SDL_CreateThread</A 92 >SDL_CreateThread</A
90 > &#8212; Creates a new thread of execution that shares its parent's properties.</DT 93 >&nbsp;--&nbsp;Creates a new thread of execution that shares its parent's properties.</DT
91 ><DT 94 ><DT
92 ><A 95 ><A
93 HREF="sdlthreadid.html" 96 HREF="sdlthreadid.html"
94 >SDL_ThreadID</A 97 >SDL_ThreadID</A
95 > &#8212; Get the 32-bit thread identifier for the current thread.</DT 98 >&nbsp;--&nbsp;Get the 32-bit thread identifier for the current thread.</DT
96 ><DT 99 ><DT
97 ><A 100 ><A
98 HREF="sdlgetthreadid.html" 101 HREF="sdlgetthreadid.html"
99 >SDL_GetThreadID</A 102 >SDL_GetThreadID</A
100 > &#8212; Get the SDL thread ID of a SDL_Thread</DT 103 >&nbsp;--&nbsp;Get the SDL thread ID of a SDL_Thread</DT
101 ><DT 104 ><DT
102 ><A 105 ><A
103 HREF="sdlwaitthread.html" 106 HREF="sdlwaitthread.html"
104 >SDL_WaitThread</A 107 >SDL_WaitThread</A
105 > &#8212; Wait for a thread to finish.</DT 108 >&nbsp;--&nbsp;Wait for a thread to finish.</DT
106 ><DT 109 ><DT
107 ><A 110 ><A
108 HREF="sdlkillthread.html" 111 HREF="sdlkillthread.html"
109 >SDL_KillThread</A 112 >SDL_KillThread</A
110 > &#8212; Gracelessly terminates the thread.</DT 113 >&nbsp;--&nbsp;Gracelessly terminates the thread.</DT
111 ><DT 114 ><DT
112 ><A 115 ><A
113 HREF="sdlcreatemutex.html" 116 HREF="sdlcreatemutex.html"
114 >SDL_CreateMutex</A 117 >SDL_CreateMutex</A
115 > &#8212; Create a mutex</DT 118 >&nbsp;--&nbsp;Create a mutex</DT
116 ><DT 119 ><DT
117 ><A 120 ><A
118 HREF="sdldestroymutex.html" 121 HREF="sdldestroymutex.html"
119 >SDL_DestroyMutex</A 122 >SDL_DestroyMutex</A
120 > &#8212; Destroy a mutex</DT 123 >&nbsp;--&nbsp;Destroy a mutex</DT
121 ><DT 124 ><DT
122 ><A 125 ><A
123 HREF="sdlmutexp.html" 126 HREF="sdlmutexp.html"
124 >SDL_mutexP</A 127 >SDL_mutexP</A
125 > &#8212; Lock a mutex</DT 128 >&nbsp;--&nbsp;Lock a mutex</DT
126 ><DT 129 ><DT
127 ><A 130 ><A
128 HREF="sdlmutexv.html" 131 HREF="sdlmutexv.html"
129 >SDL_mutexV</A 132 >SDL_mutexV</A
130 > &#8212; Unlock a mutex</DT 133 >&nbsp;--&nbsp;Unlock a mutex</DT
131 ><DT 134 ><DT
132 ><A 135 ><A
133 HREF="sdlcreatesemaphore.html" 136 HREF="sdlcreatesemaphore.html"
134 >SDL_CreateSemaphore</A 137 >SDL_CreateSemaphore</A
135 > &#8212; Creates a new semaphore and assigns an initial value to it.</DT 138 >&nbsp;--&nbsp;Creates a new semaphore and assigns an initial value to it.</DT
136 ><DT 139 ><DT
137 ><A 140 ><A
138 HREF="sdldestroysemaphore.html" 141 HREF="sdldestroysemaphore.html"
139 >SDL_DestroySemaphore</A 142 >SDL_DestroySemaphore</A
140 > &#8212; Destroys a semaphore that was created by <A 143 >&nbsp;--&nbsp;Destroys a semaphore that was created by <A
141 HREF="sdlcreatesemaphore.html" 144 HREF="sdlcreatesemaphore.html"
142 >SDL_CreateSemaphore</A 145 >SDL_CreateSemaphore</A
143 >.</DT 146 >.</DT
144 ><DT 147 ><DT
145 ><A 148 ><A
146 HREF="sdlsemwait.html" 149 HREF="sdlsemwait.html"
147 >SDL_SemWait</A 150 >SDL_SemWait</A
148 > &#8212; Lock a semaphore and suspend the thread if the semaphore value is zero.</DT 151 >&nbsp;--&nbsp;Lock a semaphore and suspend the thread if the semaphore value is zero.</DT
149 ><DT 152 ><DT
150 ><A 153 ><A
151 HREF="sdlsemtrywait.html" 154 HREF="sdlsemtrywait.html"
152 >SDL_SemTryWait</A 155 >SDL_SemTryWait</A
153 > &#8212; Attempt to lock a semaphore but don't suspend the thread.</DT 156 >&nbsp;--&nbsp;Attempt to lock a semaphore but don't suspend the thread.</DT
154 ><DT 157 ><DT
155 ><A 158 ><A
156 HREF="sdlsemwaittimeout.html" 159 HREF="sdlsemwaittimeout.html"
157 >SDL_SemWaitTimeout</A 160 >SDL_SemWaitTimeout</A
158 > &#8212; Lock a semaphore, but only wait up to a specified maximum time.</DT 161 >&nbsp;--&nbsp;Lock a semaphore, but only wait up to a specified maximum time.</DT
159 ><DT 162 ><DT
160 ><A 163 ><A
161 HREF="sdlsempost.html" 164 HREF="sdlsempost.html"
162 >SDL_SemPost</A 165 >SDL_SemPost</A
163 > &#8212; Unlock a semaphore.</DT 166 >&nbsp;--&nbsp;Unlock a semaphore.</DT
164 ><DT 167 ><DT
165 ><A 168 ><A
166 HREF="sdlsemvalue.html" 169 HREF="sdlsemvalue.html"
167 >SDL_SemValue</A 170 >SDL_SemValue</A
168 > &#8212; Return the current value of a semaphore.</DT 171 >&nbsp;--&nbsp;Return the current value of a semaphore.</DT
169 ><DT 172 ><DT
170 ><A 173 ><A
171 HREF="sdlcreatecond.html" 174 HREF="sdlcreatecond.html"
172 >SDL_CreateCond</A 175 >SDL_CreateCond</A
173 > &#8212; Create a condition variable</DT 176 >&nbsp;--&nbsp;Create a condition variable</DT
174 ><DT 177 ><DT
175 ><A 178 ><A
176 HREF="sdldestroycond.html" 179 HREF="sdldestroycond.html"
177 >SDL_DestroyCond</A 180 >SDL_DestroyCond</A
178 > &#8212; Destroy a condition variable</DT 181 >&nbsp;--&nbsp;Destroy a condition variable</DT
179 ><DT 182 ><DT
180 ><A 183 ><A
181 HREF="sdlcondsignal.html" 184 HREF="sdlcondsignal.html"
182 >SDL_CondSignal</A 185 >SDL_CondSignal</A
183 > &#8212; Restart a thread wait on a condition variable</DT 186 >&nbsp;--&nbsp;Restart a thread wait on a condition variable</DT
184 ><DT 187 ><DT
185 ><A 188 ><A
186 HREF="sdlcondbroadcast.html" 189 HREF="sdlcondbroadcast.html"
187 >SDL_CondBroadcast</A 190 >SDL_CondBroadcast</A
188 > &#8212; Restart all threads waiting on a condition variable</DT 191 >&nbsp;--&nbsp;Restart all threads waiting on a condition variable</DT
189 ><DT 192 ><DT
190 ><A 193 ><A
191 HREF="sdlcondwait.html" 194 HREF="sdlcondwait.html"
192 >SDL_CondWait</A 195 >SDL_CondWait</A
193 > &#8212; Wait on a condition variable</DT 196 >&nbsp;--&nbsp;Wait on a condition variable</DT
194 ><DT 197 ><DT
195 ><A 198 ><A
196 HREF="sdlcondwaittimeout.html" 199 HREF="sdlcondwaittimeout.html"
197 >SDL_CondWaitTimeout</A 200 >SDL_CondWaitTimeout</A
198 > &#8212; Wait on a condition variable, with timeout</DT 201 >&nbsp;--&nbsp;Wait on a condition variable, with timeout</DT
199 ></DL 202 ></DL
200 ></DIV 203 ></DIV
201 ><P 204 ><P
202 >SDL provides functions for creating threads, mutexes, semphores and condition variables.</P 205 >SDL provides functions for creating threads, mutexes, semphores and condition variables.</P
203 ><P 206 ><P
246 ><DIV 249 ><DIV
247 CLASS="NAVFOOTER" 250 CLASS="NAVFOOTER"
248 ><HR 251 ><HR
249 ALIGN="LEFT" 252 ALIGN="LEFT"
250 WIDTH="100%"><TABLE 253 WIDTH="100%"><TABLE
254 SUMMARY="Footer navigation table"
251 WIDTH="100%" 255 WIDTH="100%"
252 BORDER="0" 256 BORDER="0"
253 CELLPADDING="0" 257 CELLPADDING="0"
254 CELLSPACING="0" 258 CELLSPACING="0"
255 ><TR 259 ><TR
257 WIDTH="33%" 261 WIDTH="33%"
258 ALIGN="left" 262 ALIGN="left"
259 VALIGN="top" 263 VALIGN="top"
260 ><A 264 ><A
261 HREF="sdlcdtrack.html" 265 HREF="sdlcdtrack.html"
266 ACCESSKEY="P"
262 >Prev</A 267 >Prev</A
263 ></TD 268 ></TD
264 ><TD 269 ><TD
265 WIDTH="34%" 270 WIDTH="34%"
266 ALIGN="center" 271 ALIGN="center"
267 VALIGN="top" 272 VALIGN="top"
268 ><A 273 ><A
269 HREF="index.html" 274 HREF="index.html"
275 ACCESSKEY="H"
270 >Home</A 276 >Home</A
271 ></TD 277 ></TD
272 ><TD 278 ><TD
273 WIDTH="33%" 279 WIDTH="33%"
274 ALIGN="right" 280 ALIGN="right"
275 VALIGN="top" 281 VALIGN="top"
276 ><A 282 ><A
277 HREF="sdlcreatethread.html" 283 HREF="sdlcreatethread.html"
284 ACCESSKEY="N"
278 >Next</A 285 >Next</A
279 ></TD 286 ></TD
280 ></TR 287 ></TR
281 ><TR 288 ><TR
282 ><TD 289 ><TD
288 WIDTH="34%" 295 WIDTH="34%"
289 ALIGN="center" 296 ALIGN="center"
290 VALIGN="top" 297 VALIGN="top"
291 ><A 298 ><A
292 HREF="reference.html" 299 HREF="reference.html"
300 ACCESSKEY="U"
293 >Up</A 301 >Up</A
294 ></TD 302 ></TD
295 ><TD 303 ><TD
296 WIDTH="33%" 304 WIDTH="33%"
297 ALIGN="right" 305 ALIGN="right"