Bridge the gap between SDL1, SDL2, and UQM threads
This commit is contained in:
@@ -256,7 +256,16 @@ CreateThread_SDL (ThreadFunction func, void *data, SDWORD stackSize
|
|||||||
startInfo->sem = SDL_CreateSemaphore (0);
|
startInfo->sem = SDL_CreateSemaphore (0);
|
||||||
startInfo->thread = thread;
|
startInfo->thread = thread;
|
||||||
|
|
||||||
|
#if SDL_MAJOR_VERSION == 1
|
||||||
|
// SDL1 case
|
||||||
thread->native = SDL_CreateThread (ThreadHelper, (void *) startInfo);
|
thread->native = SDL_CreateThread (ThreadHelper, (void *) startInfo);
|
||||||
|
#elif defined(NAMED_SYNCHRO)
|
||||||
|
// SDL2 with UQM-aware named threads case
|
||||||
|
thread->native = SDL_CreateThread (ThreadHelper, thread->name, (void *) startInfo);
|
||||||
|
#else
|
||||||
|
// SDL2 without UQM-aware named threads; use a placeholder for debuggers
|
||||||
|
thread->native = SDL_CreateThread (ThreadHelper, "UQM worker thread", (void *)startInfo);
|
||||||
|
#endif
|
||||||
if (!(thread->native))
|
if (!(thread->native))
|
||||||
{
|
{
|
||||||
DestroyThreadLocal (thread->localData);
|
DestroyThreadLocal (thread->localData);
|
||||||
|
|||||||
Reference in New Issue
Block a user