Sleeping Wombat GUI  0.100
swGUI
Semaphore.h
Go to the documentation of this file.
1 #pragma once
2 
12 
13 #include <mutex>
14 #include <condition_variable>
15 
16 
17 namespace sw
18 {
19 
20 
21 
26 class Semaphore
27 {
28 private:
29 
30  std::mutex m_lock;
31  std::condition_variable m_condVariable;
33 
34 public:
35 
36  explicit Semaphore( Size initCount )
37  : m_count( initCount )
38  {}
39 
40  void Down ();
41  bool TryDown ();
42  void Up ();
43 
44 };
45 
46 
47 
48 } // sw
49 
Size m_count
Definition: Semaphore.h:32
std::mutex m_lock
Definition: Semaphore.h:30
void Up()
Definition: Semaphore.cpp:44
bool TryDown()
Definition: Semaphore.cpp:29
void Down()
Definition: Semaphore.cpp:18
Definition: DirectInputModule.cpp:11
std::condition_variable m_condVariable
Definition: Semaphore.h:31
Semaphore(Size initCount)
Definition: Semaphore.h:36
Plik zawiera definicje podstawowych typów zmiennych.
Semaphore class.
Definition: Semaphore.h:26
size_t Size
Definition: TypesDefinitions.h:35