26#include <SDL_thread.h>
67 mMutex = SDL_CreateMutex();
77 if (SDL_mutexP(
mMutex) == -1)
78 Log::info(
"Mutex locking failed: %s", SDL_GetError());
83 if (SDL_mutexV(
mMutex) == -1)
84 Log::info(
"Mutex unlocking failed: %s", SDL_GetError());
A convenience class for locking a mutex.
MutexLocker & operator=(const MutexLocker &)=delete
MutexLocker(Mutex *mutex)
MutexLocker(const MutexLocker &)=delete
A mutex provides mutual exclusion of access to certain data that is accessed by multiple threads.
Mutex(const Mutex &)=delete
Mutex & operator=(const Mutex &)=delete
Locked(Locked &&rhs)=delete
Locked(T &data, Mutex &mutex)
Locked & operator=(Locked &&)=delete
Locked & operator=(const Locked &)=delete
Locked(const Locked &)=delete
A template class for wrapping data that is accessed by multiple threads.
ThreadSafe(const T &data)
void info(const char *log_text,...) LOG_PRINTF_ATTR