Simplified Windows RunThread().
Removed checks for things that are always true, free unneeded struct before calling thread entry point, instead of after thread completes.
This commit is contained in:
parent
966f4f55fd
commit
596099f2c0
1 changed files with 6 additions and 13 deletions
|
@ -79,19 +79,12 @@ static DWORD
|
||||||
RunThread(void *data)
|
RunThread(void *data)
|
||||||
{
|
{
|
||||||
pThreadStartParms pThreadParms = (pThreadStartParms) data;
|
pThreadStartParms pThreadParms = (pThreadStartParms) data;
|
||||||
pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
|
pfnSDL_CurrentEndThread pfnEndThread = pThreadParms->pfnCurrentEndThread;
|
||||||
|
void *args = pThreadParms->args;
|
||||||
// Call the thread function!
|
SDL_free(pThreadParms);
|
||||||
SDL_RunThread(pThreadParms->args);
|
SDL_RunThread(args);
|
||||||
|
if (pfnEndThread != NULL)
|
||||||
// Get the current endthread we have to use!
|
pfnEndThread(0);
|
||||||
if (pThreadParms) {
|
|
||||||
pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread;
|
|
||||||
SDL_free(pThreadParms);
|
|
||||||
}
|
|
||||||
// Call endthread!
|
|
||||||
if (pfnCurrentEndThread)
|
|
||||||
(*pfnCurrentEndThread) (0);
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue