Implemented TLS for all platforms.

This commit is contained in:
Camilla Berglund
2012-08-13 16:03:44 +02:00
parent c594bb4689
commit 18a5aba8f1
5 changed files with 67 additions and 7 deletions
+13 -1
View File
@@ -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;
//========================================================================