Oxygine  1
2g game engine
Mutex.h
1 #pragma once
2 #include "oxygine-include.h"
3 
4 #if defined(_WIN32) && !defined(__MINGW32__)
5 typedef struct pthread_mutex_t_* pthread_mutex_t;
6 #else
7 # include "pthread.h"
8 #endif
9 
10 namespace oxygine
11 {
12  class Mutex
13  {
14  public:
15  Mutex(bool recursive = false);
16  ~Mutex();
17 
18  void lock();
19  void unlock();
20 
21  private:
22  Mutex(const Mutex&) {}
23  void operator = (const Mutex&) {}
24 
25  pthread_mutex_t _handle;
26  //void *_handle;
27  };
28 
30  {
31  public:
32  MutexAutoLock(Mutex& m): _m(m) {_m.lock();}
33  ~MutexAutoLock() {_m.unlock();}
34 
35  private:
36  Mutex& _m;
37  };
38 }
Definition: Mutex.h:12
Definition: Mutex.h:29
–oxgl-end–!
Definition: Actor.h:14