mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Implemented TLS for all platforms.
This commit is contained in:
+13
-1
@@ -33,10 +33,22 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Thread local storage attribute macro
|
||||
//========================================================================
|
||||
#if defined(_MSC_VER)
|
||||
#define _GLFW_TLS __declspec(thread)
|
||||
#elif defined(__GNUC__)
|
||||
#define _GLFW_TLS __thread
|
||||
#else
|
||||
#define _GLFW_TLS
|
||||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// The per-thread current context/window pointer
|
||||
//========================================================================
|
||||
__declspec(thread) _GLFWwindow* _glfwCurrentWindow = NULL;
|
||||
static _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL;
|
||||
|
||||
|
||||
//========================================================================
|
||||
|
||||
Reference in New Issue
Block a user