diff --git a/CMakeLists.txt b/CMakeLists.txt index b3ebf15..8bf5d30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,8 +184,6 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") if (MINGW) set(ldflags ${ldflags} "-mwindows") - else() - set(sys_libs ${sys_libs} pthread) endif() if (os STREQUAL "linux") @@ -618,7 +616,6 @@ if (APPLE) sys/sys_local.cpp sys/posix/posix_net.cpp sys/posix/posix_signal.cpp - sys/posix/posix_threads.cpp sys/posix/posix_main.cpp ) @@ -660,7 +657,6 @@ else() sys/sys_local.cpp sys/posix/posix_net.cpp sys/posix/posix_signal.cpp - sys/posix/posix_threads.cpp sys/posix/posix_main.cpp sys/linux/main.cpp ) diff --git a/sys/platform.h b/sys/platform.h index b3d6029..d52c202 100644 --- a/sys/platform.h +++ b/sys/platform.h @@ -66,8 +66,6 @@ If you have questions concerning this license or the applicable additional terms #define assertmem( x, y ) #endif -#define THREAD_RETURN_TYPE DWORD - #endif @@ -107,8 +105,6 @@ If you have questions concerning this license or the applicable additional terms #define assertmem( x, y ) -#define THREAD_RETURN_TYPE void * - #endif @@ -163,8 +159,6 @@ If you have questions concerning this license or the applicable additional terms #define assertmem( x, y ) -#define THREAD_RETURN_TYPE void * - #endif diff --git a/sys/sys_public.h b/sys/sys_public.h index 9c02f9f..3b4a80d 100644 --- a/sys/sys_public.h +++ b/sys/sys_public.h @@ -358,28 +358,21 @@ void Sys_ShutdownNetworking( void ); ============================================================== */ -typedef THREAD_RETURN_TYPE (*xthread_t)( void * ); +struct SDL_Thread; -typedef enum { - THREAD_NORMAL, - THREAD_ABOVE_NORMAL, - THREAD_HIGHEST -} xthreadPriority; +typedef int (*xthread_t)( void * ); typedef struct { - const char * name; - intptr_t threadHandle; - size_t threadId; + const char *name; + SDL_Thread *threadHandle; + unsigned int threadId; } xthreadInfo; -extern xthreadInfo *g_threads[MAX_THREADS]; -extern int g_thread_count; - -void Sys_CreateThread( xthread_t function, void *parms, xthreadPriority priority, xthreadInfo &info, const char *name, xthreadInfo *threads[MAX_THREADS], int *thread_count ); +void Sys_CreateThread( xthread_t function, void *parms, xthreadInfo &info, const char *name ); void Sys_DestroyThread( xthreadInfo& info ); // sets threadHandle back to 0 // find the name of the calling thread -// if index != NULL, set the index in g_threads array (use -1 for "main" thread) +// if index != NULL, set the index in threads array (use -1 for "main" thread) const char * Sys_GetThreadName( int *index = 0 ); extern void Sys_InitThreads();