15 #include <vsg/core/Inherit.h>
17 #include <condition_variable>
27 explicit Latch(
int num) :
30 explicit Latch(
size_t num) :
31 Latch(
static_cast<int>(num)) {}
37 if (_count.exchange(0) != 0)
53 if (_count.fetch_sub(1) <= 1)
71 std::unique_lock lock(_mutex);
78 virtual void release()
80 std::unique_lock lock(_mutex);
84 int count()
const {
return _count.load(); }
89 std::atomic_int _count;
91 std::condition_variable _cv;
Latch provides a means for synchronizing multiple threads that waits for the latch count to be decrem...
Definition: Latch.h:25