24 latch(std::size_t count);
41 template <
typename Rep,
typename Period>
44 return cv.wait_for(
lock, dur, [&]() {
return count == 0; });
53 template <
typename Clock,
typename Duration>
56 return cv.wait_until(
lock, tp, [&]() {
return count == 0; });
iterator_traits< _InputIterator >::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp &__value)
void lock(_L1 &__l1, _L2 &__l2, _L3 &... __l3)
bool wait_until(const std::chrono::time_point< Clock, Duration > &tp) const
Wait until the latch is unlocked until a specific timepoint.
Definition threading.h:54
void wait() const
Wait until the latch is unlocked.
Definition threading.cpp:7
void count_down(std::size_t n=1)
Counts down the internal counter.
Definition threading.cpp:12
latch(std::size_t count)
Create a new latch.
Definition threading.cpp:5
bool wait_for(const std::chrono::duration< Rep, Period > &dur) const
Wait until the latch is unlocked, with a timeout.
Definition threading.h:42
A collection of utility functions and classes with common use-cases.
Definition SwerveController.cpp:145