Mercurial > sdl-ios-xcode
comparison src/thread/SDL_thread.c @ 1190:173c063d4f55
OS/2 port!
This was mostly, if not entirely, written by "Doodle" and "Caetano":
doodle@scenergy.dfmk.hu
daniel@caetano.eng.br
--ryan.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 23 Nov 2005 07:29:56 +0000 |
parents | b8d311d90021 |
children | c9b51268668f |
comparison
equal
deleted
inserted
replaced
1189:c96b326b90ba | 1190:173c063d4f55 |
---|---|
216 | 216 |
217 /* Run the function */ | 217 /* Run the function */ |
218 *statusloc = userfunc(userdata); | 218 *statusloc = userfunc(userdata); |
219 } | 219 } |
220 | 220 |
221 SDL_Thread *SDL_CreateThread(int (*fn)(void *), void *data) | 221 #ifdef __OS2__ |
222 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread_Core(int (*fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) | |
223 #else | |
224 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data) | |
225 #endif | |
222 { | 226 { |
223 SDL_Thread *thread; | 227 SDL_Thread *thread; |
224 thread_args *args; | 228 thread_args *args; |
225 int ret; | 229 int ret; |
226 | 230 |
252 | 256 |
253 /* Add the thread to the list of available threads */ | 257 /* Add the thread to the list of available threads */ |
254 SDL_AddThread(thread); | 258 SDL_AddThread(thread); |
255 | 259 |
256 /* Create the thread and go! */ | 260 /* Create the thread and go! */ |
261 #ifdef __OS2__ | |
262 ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread); | |
263 #else | |
257 ret = SDL_SYS_CreateThread(thread, args); | 264 ret = SDL_SYS_CreateThread(thread, args); |
265 #endif | |
258 if ( ret >= 0 ) { | 266 if ( ret >= 0 ) { |
259 /* Wait for the thread function to use arguments */ | 267 /* Wait for the thread function to use arguments */ |
260 SDL_SemWait(args->wait); | 268 SDL_SemWait(args->wait); |
261 } else { | 269 } else { |
262 /* Oops, failed. Gotta free everything */ | 270 /* Oops, failed. Gotta free everything */ |