mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-24 03:58:28 +00:00
os/2: port from SDL2-2.0.4 to SDL2-2.0.5:
changes to SDL_os2audio.c, SDL_os2video.c, os2/SDL_systhread.c in order to accomodate SDL2-2.0.5 changes. - audio: WaitDone() is gone, CloseDevice() interface changes. - events / video: DropFile() changes: SDL_DROPBEGIN and SDL_DROPCOMPLETE events, window IDs for drops. - thread: struct SDL_Thread->stacksize
This commit is contained in:
@@ -74,14 +74,24 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args,
|
||||
if ( pThreadParms == NULL )
|
||||
return SDL_OutOfMemory();
|
||||
|
||||
// Save the function which we will have to call to clear the RTL of calling app!
|
||||
pThreadParms->pfnCurrentEndThread = pfnEndThread;
|
||||
if (thread->stacksize == 0)
|
||||
thread->stacksize = 65536;
|
||||
|
||||
// Also save the real parameters we have to pass to thread function
|
||||
pThreadParms->args = args;
|
||||
|
||||
// Start the thread using the runtime library of calling app!
|
||||
thread->handle = (SYS_ThreadHandle)
|
||||
( (size_t) pfnBeginThread( RunThread, NULL, 65535, pThreadParms ) );
|
||||
if (pfnBeginThread) {
|
||||
// Save the function which we will have to call to clear the RTL of calling app!
|
||||
pThreadParms->pfnCurrentEndThread = pfnEndThread;
|
||||
// Start the thread using the runtime library of calling app!
|
||||
thread->handle = (SYS_ThreadHandle)
|
||||
pfnBeginThread( RunThread, NULL, thread->stacksize, pThreadParms );
|
||||
}
|
||||
else {
|
||||
pThreadParms->pfnCurrentEndThread = _endthread;
|
||||
thread->handle = (SYS_ThreadHandle)
|
||||
_beginthread( RunThread, NULL, thread->stacksize, pThreadParms );
|
||||
}
|
||||
|
||||
if ( thread->handle == -1 )
|
||||
return SDL_SetError( "Not enough resources to create thread" );
|
||||
|
Reference in New Issue
Block a user