diff --git a/src/egl_context.c b/src/egl_context.c index 1b412cec..d6226238 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -178,7 +178,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig, // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) + if (!_glfwCreateContextTLS()) return GL_FALSE; _glfw.egl.display = eglGetDisplay((EGLNativeDisplayType)_GLFW_EGL_NATIVE_DISPLAY); @@ -210,7 +210,7 @@ void _glfwTerminateContextAPI(void) { eglTerminate(_glfw.egl.display); - _glfwTerminateTLS(); + _glfwDestroyContextTLS(); } #define setEGLattrib(attribName, attribValue) \ @@ -461,7 +461,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } - _glfwSetCurrentContext(window); + _glfwSetContextTLS(window); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) diff --git a/src/glx_context.c b/src/glx_context.c index f342c651..1101912f 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -156,7 +156,7 @@ static GLXContext createLegacyContext(_GLFWwindow* window, // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) + if (!_glfwCreateContextTLS()) return GL_FALSE; _glfw.glx.handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); @@ -260,7 +260,7 @@ void _glfwTerminateContextAPI(void) _glfw.glx.handle = NULL; } - _glfwTerminateTLS(); + _glfwDestroyContextTLS(); } #define setGLXattrib(attribName, attribValue) \ @@ -477,7 +477,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) else glXMakeCurrent(_glfw.x11.display, None, NULL); - _glfwSetCurrentContext(window); + _glfwSetContextTLS(window); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) diff --git a/src/nsgl_context.m b/src/nsgl_context.m index 28758060..15af8356 100644 --- a/src/nsgl_context.m +++ b/src/nsgl_context.m @@ -35,7 +35,7 @@ // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) + if (!_glfwCreateContextTLS()) return GL_FALSE; _glfw.nsgl.framework = @@ -54,7 +54,7 @@ int _glfwInitContextAPI(void) // void _glfwTerminateContextAPI(void) { - _glfwTerminateTLS(); + _glfwDestroyContextTLS(); } // Create the OpenGL context @@ -257,7 +257,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) else [NSOpenGLContext clearCurrentContext]; - _glfwSetCurrentContext(window); + _glfwSetContextTLS(window); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) diff --git a/src/posix_tls.c b/src/posix_tls.c index 70fe19bb..fe703551 100644 --- a/src/posix_tls.c +++ b/src/posix_tls.c @@ -32,7 +32,7 @@ ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -int _glfwInitTLS(void) +int _glfwCreateContextTLS(void) { if (pthread_key_create(&_glfw.posix_tls.context, NULL) != 0) { @@ -44,12 +44,12 @@ int _glfwInitTLS(void) return GL_TRUE; } -void _glfwTerminateTLS(void) +void _glfwDestroyContextTLS(void) { pthread_key_delete(_glfw.posix_tls.context); } -void _glfwSetCurrentContext(_GLFWwindow* context) +void _glfwSetContextTLS(_GLFWwindow* context) { pthread_setspecific(_glfw.posix_tls.context, context); } diff --git a/src/posix_tls.h b/src/posix_tls.h index d6fa000d..2d702406 100644 --- a/src/posix_tls.h +++ b/src/posix_tls.h @@ -42,8 +42,8 @@ typedef struct _GLFWtlsPOSIX } _GLFWtlsPOSIX; -int _glfwInitTLS(void); -void _glfwTerminateTLS(void); -void _glfwSetCurrentContext(_GLFWwindow* context); +int _glfCreateContextTLS(void); +void _glfwDestroyContextTLS(void); +void _glfwSetContextTLS(_GLFWwindow* context); #endif // _posix_tls_h_ diff --git a/src/wgl_context.c b/src/wgl_context.c index c7293e08..cc740a3a 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -269,7 +269,7 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) + if (!_glfwCreateContextTLS()) return GL_FALSE; _glfw.wgl.opengl32.instance = LoadLibraryW(L"opengl32.dll"); @@ -289,7 +289,7 @@ void _glfwTerminateContextAPI(void) if (_glfw.wgl.opengl32.instance) FreeLibrary(_glfw.wgl.opengl32.instance); - _glfwTerminateTLS(); + _glfwDestroyContextTLS(); } #define setWGLattrib(attribName, attribValue) \ @@ -565,7 +565,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) else wglMakeCurrent(NULL, NULL); - _glfwSetCurrentContext(window); + _glfwSetContextTLS(window); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) diff --git a/src/win32_tls.c b/src/win32_tls.c index 088e25df..2e25e9ba 100644 --- a/src/win32_tls.c +++ b/src/win32_tls.c @@ -32,7 +32,7 @@ ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -int _glfwInitTLS(void) +int _glfwCreateContextTLS(void) { _glfw.win32_tls.context = TlsAlloc(); if (_glfw.win32_tls.context == TLS_OUT_OF_INDEXES) @@ -46,13 +46,13 @@ int _glfwInitTLS(void) return GL_TRUE; } -void _glfwTerminateTLS(void) +void _glfwDestroyContextTLS(void) { if (_glfw.win32_tls.allocated) TlsFree(_glfw.win32_tls.context); } -void _glfwSetCurrentContext(_GLFWwindow* context) +void _glfwSetContextTLS(_GLFWwindow* context) { TlsSetValue(_glfw.win32_tls.context, context); } diff --git a/src/win32_tls.h b/src/win32_tls.h index 3ffef725..cb79cb41 100644 --- a/src/win32_tls.h +++ b/src/win32_tls.h @@ -41,8 +41,8 @@ typedef struct _GLFWtlsWin32 } _GLFWtlsWin32; -int _glfwInitTLS(void); -void _glfwTerminateTLS(void); -void _glfwSetCurrentContext(_GLFWwindow* context); +int _glfwCreateContextTLS(void); +void _glfwDestroyContextTLS(void); +void _glfwSetContextTLS(_GLFWwindow* context); #endif // _win32_tls_h_