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:
Ozkan Sezer
2020-10-14 23:01:03 +03:00
parent 5f3f67b16b
commit 222f026899
3 changed files with 23 additions and 22 deletions

View File

@@ -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" );