UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
scopedmutex.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL_mutex.h>
4 
8 class ScopedMutex {
9 private:
10  SDL_mutex* _mutex;
11 public:
12  ScopedMutex (SDL_mutex *mutex) :
13  _mutex(mutex)
14  {
15  SDL_LockMutex(_mutex);
16  }
17 
19  {
20  SDL_UnlockMutex(_mutex);
21  }
22 };
SDL_mutex * _mutex
Definition: scopedmutex.h:10
ScopedMutex(SDL_mutex *mutex)
Definition: scopedmutex.h:12