46 typedef struct SDL_Thread SDL_Thread;
49 typedef unsigned long SDL_threadID;
52 typedef unsigned int SDL_TLSID;
60 SDL_THREAD_PRIORITY_LOW,
61 SDL_THREAD_PRIORITY_NORMAL,
62 SDL_THREAD_PRIORITY_HIGH,
63 SDL_THREAD_PRIORITY_TIME_CRITICAL
72 #if defined(__WIN32__) && !defined(HAVE_LIBC) 93 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD 96 typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread)
97 (
void *, unsigned, unsigned (__stdcall *func)(
void *),
98 void * ,
unsigned,
unsigned * );
99 typedef void (__cdecl * pfnSDL_CurrentEndThread) (
unsigned code);
104 extern DECLSPEC SDL_Thread *SDLCALL
106 pfnSDL_CurrentBeginThread pfnBeginThread,
107 pfnSDL_CurrentEndThread pfnEndThread);
109 extern DECLSPEC SDL_Thread *SDLCALL
111 const char *name,
const size_t stacksize,
void *data,
112 pfnSDL_CurrentBeginThread pfnBeginThread,
113 pfnSDL_CurrentEndThread pfnEndThread);
119 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API 120 #undef SDL_CreateThread 121 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) 122 #undef SDL_CreateThreadWithStackSize 123 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) 125 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) 126 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) 129 #elif defined(__OS2__) 134 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD 140 typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(
void *),
void *,
unsigned,
void * );
141 typedef void (*pfnSDL_CurrentEndThread)(void);
142 extern DECLSPEC SDL_Thread *SDLCALL
144 pfnSDL_CurrentBeginThread pfnBeginThread,
145 pfnSDL_CurrentEndThread pfnEndThread);
146 extern DECLSPEC SDL_Thread *SDLCALL
148 pfnSDL_CurrentBeginThread pfnBeginThread,
149 pfnSDL_CurrentEndThread pfnEndThread);
150 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API 151 #undef SDL_CreateThread 152 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) 153 #undef SDL_CreateThreadWithStackSize 154 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) 156 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) 157 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) 168 extern DECLSPEC SDL_Thread *SDLCALL
197 extern DECLSPEC SDL_Thread *SDLCALL
214 extern DECLSPEC SDL_threadID SDLCALL
SDL_ThreadID(
void);
221 extern DECLSPEC SDL_threadID SDLCALL
SDL_GetThreadID(SDL_Thread * thread);
246 extern DECLSPEC
void SDLCALL
SDL_WaitThread(SDL_Thread * thread,
int *status);
318 extern DECLSPEC
void * SDLCALL
SDL_TLSGet(SDL_TLSID
id);
332 extern DECLSPEC
int SDLCALL
SDL_TLSSet(SDL_TLSID
id,
const void *value,
void (SDLCALL *destructor)(
void*));
DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status)
DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority)
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)
SDL_ThreadPriority
Definition: SDL_thread.h:59
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 SDL_Thread *SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data)
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_DetachThread(SDL_Thread *thread)
DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data)
DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void)
DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread *thread)
int(SDLCALL * SDL_ThreadFunction)(void *data)
Definition: SDL_thread.h:70