42 if (pthread_key_create(&tls->posix.key,
NULL) != 0)
45 "POSIX: Failed to create context TLS");
55 if (tls->posix.allocated)
56 pthread_key_delete(tls->posix.key);
63 return pthread_getspecific(tls->posix.key);
69 pthread_setspecific(tls->posix.key, value);
76 if (pthread_mutex_init(&mutex->posix.handle,
NULL) != 0)
82 return mutex->posix.allocated =
GLFW_TRUE;
87 if (mutex->posix.allocated)
88 pthread_mutex_destroy(&mutex->posix.handle);
95 pthread_mutex_lock(&mutex->posix.handle);
101 pthread_mutex_unlock(&mutex->posix.handle);
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
void _glfwInputError(int code, const char *format,...)
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
void * _glfwPlatformGetTls(_GLFWtls *tls)
void _glfwPlatformDestroyTls(_GLFWtls *tls)