STE-Industries: utilities testing
Mutex.h
Go to the documentation of this file.
1 
13 # if !defined MUTEX_H
14 
15 # define MUTEX_H
16 
17 # include <pthread.h>
18 
19 namespace GraphicSpace
20 {
21 
27 
28 class Mutex
29  {
30  private:
31 
34  static constexpr unsigned int MUTEX_INIT_OK = 0;
35 
38  static constexpr unsigned int MUTEX_DESTROY_OK = 0;
39 
42  static constexpr unsigned int MUTEX_LOCK_OK = 0;
43 
46  static constexpr unsigned int MUTEX_UNLOCK_OK = 0;
47 
50  bool Active;
51 
54  pthread_mutex_t MutexData;
55 
56  public:
57 
58  Mutex(void) noexcept;
59 
60  Mutex(const Mutex& thisThread) = delete;
61 
62  Mutex(Mutex&& thisMutex) = delete;
63 
64  ~Mutex(void) noexcept(false);
65 
66  Mutex& operator = (const Mutex& thisMutex) =
67  delete;
68 
69  Mutex& operator = (Mutex&& thisMutex) = delete;
70 
71  void Initialize(void) noexcept(false);
72 
73  void Finalize(void) noexcept(false);
74 
75  void Lock(void) noexcept(false);
76 
77  void Unlock(void) noexcept(false);
78 
79  };
80 
81 }
82 
83 # endif
GraphicSpace::Mutex::MUTEX_LOCK_OK
static constexpr unsigned int MUTEX_LOCK_OK
Definition: Mutex.h:42
GraphicSpace::Mutex::MutexData
pthread_mutex_t MutexData
Definition: Mutex.h:54
GraphicSpace::Mutex::Active
bool Active
Definition: Mutex.h:50
GraphicSpace::Mutex::MUTEX_UNLOCK_OK
static constexpr unsigned int MUTEX_UNLOCK_OK
Definition: Mutex.h:46
GraphicSpace::Mutex::operator=
Mutex & operator=(const Mutex &thisMutex)=delete
GraphicSpace::Mutex::MUTEX_DESTROY_OK
static constexpr unsigned int MUTEX_DESTROY_OK
Definition: Mutex.h:38
GraphicSpace::Mutex::Unlock
void Unlock(void) noexcept(false)
Definition: Mutex.cpp:142
GraphicSpace::Mutex::~Mutex
~Mutex(void) noexcept(false)
Definition: Mutex.cpp:46
GraphicSpace::Mutex::Mutex
Mutex(void) noexcept
Definition: Mutex.cpp:31
GraphicSpace::Mutex::Initialize
void Initialize(void) noexcept(false)
Definition: Mutex.cpp:67
GraphicSpace::Mutex
Definition: Mutex.h:28
GraphicSpace::Mutex::Lock
void Lock(void) noexcept(false)
Definition: Mutex.cpp:118
GraphicSpace
Definition: Bitmap.cpp:29
GraphicSpace::Mutex::Finalize
void Finalize(void) noexcept(false)
Definition: Mutex.cpp:93
GraphicSpace::Mutex::MUTEX_INIT_OK
static constexpr unsigned int MUTEX_INIT_OK
Definition: Mutex.h:34