46 typedef struct SDL_Thread SDL_Thread;
49 typedef unsigned long SDL_threadID;
52 typedef unsigned int SDL_TLSID;
65 SDL_THREAD_PRIORITY_LOW,
66 SDL_THREAD_PRIORITY_NORMAL,
67 SDL_THREAD_PRIORITY_HIGH,
68 SDL_THREAD_PRIORITY_TIME_CRITICAL
77 #if defined(__WIN32__)
98 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
101 typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
102 (
void *, unsigned, unsigned (__stdcall *func)(
void *),
103 void * ,
unsigned,
unsigned * );
104 typedef void (__cdecl * pfnSDL_CurrentEndThread) (
unsigned code);
106 #ifndef SDL_beginthread
107 #define SDL_beginthread _beginthreadex
109 #ifndef SDL_endthread
110 #define SDL_endthread _endthreadex
116 extern DECLSPEC SDL_Thread *SDLCALL
118 pfnSDL_CurrentBeginThread pfnBeginThread,
119 pfnSDL_CurrentEndThread pfnEndThread);
121 extern DECLSPEC SDL_Thread *SDLCALL
123 const char *name,
const size_t stacksize,
void *data,
124 pfnSDL_CurrentBeginThread pfnBeginThread,
125 pfnSDL_CurrentEndThread pfnEndThread);
131 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
132 #undef SDL_CreateThread
133 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
134 #undef SDL_CreateThreadWithStackSize
135 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
137 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
138 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
141 #elif defined(__OS2__)
146 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
154 typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(
void *),
void *,
unsigned,
void * );
155 typedef void (*pfnSDL_CurrentEndThread)(void);
157 #ifndef SDL_beginthread
158 #define SDL_beginthread _beginthread
160 #ifndef SDL_endthread
161 #define SDL_endthread _endthread
164 extern DECLSPEC SDL_Thread *SDLCALL
166 pfnSDL_CurrentBeginThread pfnBeginThread,
167 pfnSDL_CurrentEndThread pfnEndThread);
168 extern DECLSPEC SDL_Thread *SDLCALL
170 pfnSDL_CurrentBeginThread pfnBeginThread,
171 pfnSDL_CurrentEndThread pfnEndThread);
173 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
174 #undef SDL_CreateThread
175 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
176 #undef SDL_CreateThreadWithStackSize
177 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
179 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
180 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
191 extern DECLSPEC SDL_Thread *SDLCALL
220 extern DECLSPEC SDL_Thread *SDLCALL
355 extern 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 SDL_threadID SDLCALL SDL_ThreadID(void)
int(SDLCALL * SDL_ThreadFunction)(void *data)
Definition: SDL_thread.h:75
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data)
DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void(SDLCALL *destructor)(void *))
Set the value associated with a thread local storage ID for the current thread.
DECLSPEC void *SDLCALL SDL_TLSGet(SDL_TLSID id)
Get the value associated with a thread local storage ID for the current thread.
DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread)
DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void)
Create an identifier that is globally visible to all threads but refers to data that is thread-specif...
DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status)
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data)
SDL_ThreadPriority
Definition: SDL_thread.h:64
DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority)
DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread *thread)