| 19 | } |
| 20 | |
| 21 | void Barrier::Wait() |
| 22 | { |
| 23 | std::unique_lock<std::mutex> lock { mutex_ }; |
| 24 | |
| 25 | if (--counter_ == 0) |
| 26 | { |
| 27 | counter_ = threadCount_; |
| 28 | var_.notify_all(); |
| 29 | } |
| 30 | else |
| 31 | var_.wait(lock, [this]{ return (counter_ == threadCount_); }); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | } // /namespace LLGL |
no test coverage detected