Lines Matching refs:tls
40 GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls)
42 assert(tls->posix.allocated == GLFW_FALSE);
44 if (pthread_key_create(&tls->posix.key, NULL) != 0)
51 tls->posix.allocated = GLFW_TRUE;
55 void _glfwPlatformDestroyTls(_GLFWtls* tls)
57 if (tls->posix.allocated)
58 pthread_key_delete(tls->posix.key);
59 memset(tls, 0, sizeof(_GLFWtls));
62 void* _glfwPlatformGetTls(_GLFWtls* tls)
64 assert(tls->posix.allocated == GLFW_TRUE);
65 return pthread_getspecific(tls->posix.key);
68 void _glfwPlatformSetTls(_GLFWtls* tls, void* value)
70 assert(tls->posix.allocated == GLFW_TRUE);
71 pthread_setspecific(tls->posix.key, value);