mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-26 01:31:56 +01:00
Common/Barrier: add method to get current generation
This commit is contained in:
parent
969dc3b46f
commit
fbad420240
@ -79,9 +79,14 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::size_t Generation() const {
|
||||||
|
std::unique_lock<std::mutex> lk(mutex);
|
||||||
|
return generation;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::condition_variable condvar;
|
std::condition_variable condvar;
|
||||||
std::mutex mutex;
|
mutable std::mutex mutex;
|
||||||
std::size_t count;
|
std::size_t count;
|
||||||
std::size_t waiting = 0;
|
std::size_t waiting = 0;
|
||||||
std::size_t generation = 0; // Incremented once each time the barrier is used
|
std::size_t generation = 0; // Incremented once each time the barrier is used
|
||||||
|
Loading…
Reference in New Issue
Block a user