Bridge the gap between SDL1, SDL2, and UQM threads

This commit is contained in:
Michael Martin
2019-08-24 18:12:59 -07:00
parent 371a42acdd
commit d5407378ac
+9
View File
@@ -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);