22 #include "../../SDL_internal.h"
26 #include "../../core/os2/SDL_os2.h"
29 #include "../SDL_thread_c.h"
31 #define INCL_DOSPROCESS
32 #define INCL_DOSERRORS
37 static ULONG cTLSAlloc = 0;
40 void SDL_OS2TLSAlloc(
void)
44 if (cTLSAlloc == 0 || ppSDLTLSData ==
NULL) {
46 ulRC = DosAllocThreadLocalMemory(1, (PULONG *)&ppSDLTLSData);
47 if (ulRC != NO_ERROR) {
48 debug_os2(
"DosAllocThreadLocalMemory() failed, rc = %u", ulRC);
55 void SDL_OS2TLSFree(
void)
62 if (cTLSAlloc == 0 && ppSDLTLSData !=
NULL) {
64 ulRC = DosFreeThreadLocalMemory((PULONG)ppSDLTLSData);
65 if (ulRC != NO_ERROR) {
66 debug_os2(
"DosFreeThreadLocalMemory() failed, rc = %u", ulRC);
75 return (ppSDLTLSData ==
NULL)?
NULL : *ppSDLTLSData;
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
int SDL_SYS_SetTLSData(SDL_TLSData *data)
SDL_TLSData * SDL_SYS_GetTLSData(void)