Rename (un)lock_mutex to mutex_(un)lock

For consistency, rename lock_mutex and unlock_mutex to mutex_lock and
mutex_unlock.
This commit is contained in:
Romain Vimont
2017-12-15 16:37:17 +01:00
parent ad667bfa20
commit c4266e487b
3 changed files with 10 additions and 6 deletions

View File

@@ -1,14 +1,18 @@
#ifndef LOCKUTIL_H
#define LOCKUTIL_H
static inline void lock_mutex(SDL_mutex *mutex) {
#include <stdlib.h>
#include <SDL2/SDL_log.h>
#include <SDL2/SDL_mutex.h>
static inline void mutex_lock(SDL_mutex *mutex) {
if (SDL_LockMutex(mutex)) {
SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "Could not lock mutex");
exit(1);
}
}
static inline void unlock_mutex(SDL_mutex *mutex) {
static inline void mutex_unlock(SDL_mutex *mutex) {
if (SDL_UnlockMutex(mutex)) {
SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "Could not unlock mutex");
exit(1);