Sleeping Wombat GUI  0.100
swGUI
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;
36 
37 protected:
38 public:
39  explicit ThreadsBarrier ( uint16 numThreads );
40  ~ThreadsBarrier () = default;
41 
42  void ArriveAndWait ();
43 };
44 
45 
46 } // sw
47 
Size m_generation
Definition: ThreadsBarrier.h:33
uint16_t uint16
Definition: TypesDefinitions.h:29
Can block multiple threads and wait for signal. ThreadsBarrier is reusable.
Definition: ThreadsBarrier.h:27
const uint32 m_numThreads
Definition: ThreadsBarrier.h:34
std::mutex m_lock
Definition: ThreadsBarrier.h:31
Definition: DirectInputModule.cpp:11
Plik zawiera definicje podstawowych typów zmiennych.
uint32_t uint32
Definition: TypesDefinitions.h:31
std::condition_variable m_condVariable
Definition: ThreadsBarrier.h:32
~ThreadsBarrier()=default
size_t Size
Definition: TypesDefinitions.h:35
ThreadsBarrier(uint16 numThreads)
Definition: ThreadsBarrier.cpp:18
uint32 m_remain
Definition: ThreadsBarrier.h:35
void ArriveAndWait()
Definition: ThreadsBarrier.cpp:26