diff options
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/thread.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/thread.h b/src/zencore/include/zencore/thread.h index d7262324f..56ce5904b 100644 --- a/src/zencore/include/zencore/thread.h +++ b/src/zencore/include/zencore/thread.h @@ -190,6 +190,13 @@ class Latch public: Latch(std::ptrdiff_t Count) : Counter(Count) {} + void Reset(std::ptrdiff_t Count) + { + ZEN_ASSERT(Counter.load() == 0); + Complete.Reset(); + Counter.store(Count); + } + void CountDown() { std::ptrdiff_t Old = Counter.fetch_sub(1); |