mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-19 07:51:54 +00:00
Add SDL2 support in sys/threads.cpp
This commit is contained in:
parent
368bf2819c
commit
a75387c55e
1 changed files with 9 additions and 0 deletions
|
@ -26,6 +26,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#include <SDL_version.h>
|
||||
#include <SDL_mutex.h>
|
||||
#include <SDL_thread.h>
|
||||
#include <SDL_timer.h>
|
||||
|
@ -109,7 +110,11 @@ void Sys_ShutdownThreads() {
|
|||
continue;
|
||||
|
||||
Sys_Printf("WARNING: Thread '%s' still running\n", thread[i]->name);
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
// TODO no equivalent in SDL2
|
||||
#else
|
||||
SDL_KillThread(thread[i]->threadHandle);
|
||||
#endif
|
||||
thread[i] = NULL;
|
||||
}
|
||||
|
||||
|
@ -218,7 +223,11 @@ Sys_CreateThread
|
|||
void Sys_CreateThread(xthread_t function, void *parms, xthreadInfo& info, const char *name) {
|
||||
Sys_EnterCriticalSection();
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_Thread *t = SDL_CreateThread(function, name, parms);
|
||||
#else
|
||||
SDL_Thread *t = SDL_CreateThread(function, parms);
|
||||
#endif
|
||||
|
||||
if (!t) {
|
||||
common->Error("ERROR: SDL_thread for '%s' failed\n", name);
|
||||
|
|
Loading…
Reference in a new issue