Lines Matching defs:mutex
74 GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex)
76 assert(mutex->posix.allocated == GLFW_FALSE);
78 if (pthread_mutex_init(&mutex->posix.handle, NULL) != 0)
80 _glfwInputError(GLFW_PLATFORM_ERROR, "POSIX: Failed to create mutex");
84 return mutex->posix.allocated = GLFW_TRUE;
87 void _glfwPlatformDestroyMutex(_GLFWmutex* mutex)
89 if (mutex->posix.allocated)
90 pthread_mutex_destroy(&mutex->posix.handle);
91 memset(mutex, 0, sizeof(_GLFWmutex));
94 void _glfwPlatformLockMutex(_GLFWmutex* mutex)
96 assert(mutex->posix.allocated == GLFW_TRUE);
97 pthread_mutex_lock(&mutex->posix.handle);
100 void _glfwPlatformUnlockMutex(_GLFWmutex* mutex)
102 assert(mutex->posix.allocated == GLFW_TRUE);
103 pthread_mutex_unlock(&mutex->posix.handle);