38#if defined(__WIN32__) || defined(__GDK__)
57typedef struct SDL_Thread SDL_Thread;
60typedef unsigned long SDL_threadID;
63typedef unsigned int SDL_TLSID;
76 SDL_THREAD_PRIORITY_LOW,
77 SDL_THREAD_PRIORITY_NORMAL,
78 SDL_THREAD_PRIORITY_HIGH,
79 SDL_THREAD_PRIORITY_TIME_CRITICAL
91#if defined(__WIN32__) || defined(__GDK__)
112#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
114typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
115 (
void *, unsigned, unsigned (__stdcall *func)(
void *),
116 void * ,
unsigned,
unsigned * );
117typedef void (__cdecl * pfnSDL_CurrentEndThread) (
unsigned code);
119#ifndef SDL_beginthread
120#define SDL_beginthread _beginthreadex
123#define SDL_endthread _endthreadex
126extern DECLSPEC SDL_Thread *SDLCALL
128 pfnSDL_CurrentBeginThread pfnBeginThread,
129 pfnSDL_CurrentEndThread pfnEndThread);
131extern DECLSPEC SDL_Thread *SDLCALL
133 const char *name,
const size_t stacksize,
void *data,
134 pfnSDL_CurrentBeginThread pfnBeginThread,
135 pfnSDL_CurrentEndThread pfnEndThread);
138#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
139#undef SDL_CreateThread
140#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
141#undef SDL_CreateThreadWithStackSize
142#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
144#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
145#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
148#elif defined(__OS2__)
153#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
155typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(
void *),
void *,
unsigned,
void * );
156typedef void (*pfnSDL_CurrentEndThread)(void);
158#ifndef SDL_beginthread
159#define SDL_beginthread _beginthread
162#define SDL_endthread _endthread
165extern DECLSPEC SDL_Thread *SDLCALL
167 pfnSDL_CurrentBeginThread pfnBeginThread,
168 pfnSDL_CurrentEndThread pfnEndThread);
169extern DECLSPEC SDL_Thread *SDLCALL
171 pfnSDL_CurrentBeginThread pfnBeginThread,
172 pfnSDL_CurrentEndThread pfnEndThread);
174#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
175#undef SDL_CreateThread
176#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
177#undef SDL_CreateThreadWithStackSize
178#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
180#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
181#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
207extern DECLSPEC SDL_Thread *SDLCALL
253extern DECLSPEC SDL_Thread *SDLCALL
447extern DECLSPEC
int SDLCALL
SDL_TLSSet(SDL_TLSID
id,
const void *value,
void (SDLCALL *destructor)(
void*));
DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread *thread)
DECLSPEC void *SDLCALL SDL_TLSGet(SDL_TLSID id)
DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void)
int(SDLCALL * SDL_ThreadFunction)(void *data)
Definition: SDL_thread.h:88
DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread)
DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void(SDLCALL *destructor)(void *))
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data)
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data)
DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void)
DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status)
SDL_ThreadPriority
Definition: SDL_thread.h:75
DECLSPEC void SDLCALL SDL_TLSCleanup(void)
DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority)
DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread *thread)