Sleeping Wombat Common Library  0.50.0
swCommonLibrary
ThreadsBarrier.h
Go to the documentation of this file.
1 #pragma once
2 
9 
10 
11 #include <mutex>
12 #include <condition_variable>
13 
14 
15 namespace sw
16 {
17 
18 
19 
28 {
29 private:
30 
31  std::mutex m_lock;
32  std::condition_variable m_condVariable;
33  Size m_generation;
34  const uint32 m_numThreads;
35  uint32 m_remain;
36 
37 protected:
38 public:
39  explicit ThreadsBarrier ( uint16 numThreads );
40  ~ThreadsBarrier () = default;
41 
42  void ArriveAndWait ();
43 };
44 
45 
46 } // sw
47 
Can block multiple threads and wait for signal. ThreadsBarrier is reusable.
Definition: ThreadsBarrier.h:27
Definition: Exception.h:11
Plik zawiera definicje podstawowych typów zmiennych.