44 if (pthread_key_create(&tls->posix.key,
NULL) != 0)
47 "POSIX: Failed to create context TLS");
57 if (tls->posix.allocated)
58 pthread_key_delete(tls->posix.key);
64 assert(tls->posix.allocated ==
GLFW_TRUE);
65 return pthread_getspecific(tls->posix.key);
70 assert(tls->posix.allocated ==
GLFW_TRUE);
71 pthread_setspecific(tls->posix.key, value);
78 if (pthread_mutex_init(&mutex->posix.handle,
NULL) != 0)
84 return mutex->posix.allocated =
GLFW_TRUE;
89 if (mutex->posix.allocated)
90 pthread_mutex_destroy(&mutex->posix.handle);
96 assert(mutex->posix.allocated ==
GLFW_TRUE);
97 pthread_mutex_lock(&mutex->posix.handle);
102 assert(mutex->posix.allocated ==
GLFW_TRUE);
103 pthread_mutex_unlock(&mutex->posix.handle);
#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 _glfwPlatformSetTls(_GLFWtls *tls, void *value)
void _glfwPlatformDestroyTls(_GLFWtls *tls)
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
void * _glfwPlatformGetTls(_GLFWtls *tls)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)