Sleeping Wombat Common Library  0.50.0
swCommonLibrary
Semaphore.h
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;
32  Size m_count;
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 
Definition: Exception.h:11
Plik zawiera definicje podstawowych typów zmiennych.
Semaphore class.
Definition: Semaphore.h:26