scrcpy/app/src/lockutil.h
Romain Vimont 54d9148a36 Initial commit
Start a new clean history from here.
2017-12-12 15:25:15 +01:00

19 lines
416 B
C

#ifndef LOCKUTIL_H
#define LOCKUTIL_H
static inline void lock_mutex(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) {
if (SDL_UnlockMutex(mutex)) {
SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "Could not unlock mutex");
exit(1);
}
}
#endif