diff --git a/src/SDL.c b/src/SDL.c index 15e5f878b78d50..a109a9a1306722 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -200,10 +200,6 @@ int SDL_InitSubSystem(Uint32 flags) SDL_DBus_Init(); #endif -#ifdef SDL_THREAD_OS2 - SDL_OS2TLSAlloc(); /* thread/os2/SDL_systls.c */ -#endif - #ifdef SDL_VIDEO_DRIVER_WINDOWS if (flags & (SDL_INIT_HAPTIC | SDL_INIT_JOYSTICK)) { if (SDL_HelperWindowCreate() < 0) { @@ -380,9 +376,6 @@ int SDL_Init(Uint32 flags) void SDL_QuitSubSystem(Uint32 flags) { #if defined(__OS2__) -#ifdef SDL_THREAD_OS2 - SDL_OS2TLSFree(); /* thread/os2/SDL_systls.c */ -#endif SDL_OS2Quit(); #endif diff --git a/src/thread/os2/SDL_systls.c b/src/thread/os2/SDL_systls.c index 5c380dd7f8fc2d..b9ef10a14459b3 100644 --- a/src/thread/os2/SDL_systls.c +++ b/src/thread/os2/SDL_systls.c @@ -36,8 +36,7 @@ SDL_TLSData **ppSDLTLSData = NULL; static ULONG cTLSAlloc = 0; -/* SDL_OS2TLSAlloc() called from SDL_InitSubSystem() */ -void SDL_OS2TLSAlloc(void) +void SDL_SYS_InitTLSData(void) { ULONG ulRC; @@ -51,8 +50,21 @@ void SDL_OS2TLSAlloc(void) cTLSAlloc++; } -/* SDL_OS2TLSFree() called from SDL_QuitSubSystem() */ -void SDL_OS2TLSFree(void) +SDL_TLSData *SDL_SYS_GetTLSData(void) +{ + return (!ppSDLTLSData)? NULL : *ppSDLTLSData; +} + +int SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + if (!ppSDLTLSData) + return -1; + + *ppSDLTLSData = data; + return 0; +} + +void SDL_SYS_QuitTLSData(void) { ULONG ulRC; @@ -70,20 +82,6 @@ void SDL_OS2TLSFree(void) } } -SDL_TLSData *SDL_SYS_GetTLSData(void) -{ - return (!ppSDLTLSData)? NULL : *ppSDLTLSData; -} - -int SDL_SYS_SetTLSData(SDL_TLSData *data) -{ - if (!ppSDLTLSData) - return -1; - - *ppSDLTLSData = data; - return 0; -} - #endif /* SDL_THREAD_OS2 */ /* vi: set ts=4 sw=4 expandtab: */