71#include <condition_variable>
85 , std::condition_variable_any
92 condVar().wait (
mutex(), std::forward<PRED> (predicate));
98 template<
class REPR,
class PERI,
class PRED>
100 wait_for (std::chrono::duration<REPR, PERI>
const& timeout, PRED&& predicate)
102 return condVar().wait_for (
mutex(), timeout, std::forward<PRED> (predicate));
108 return static_cast<MTX&
> (*this);
110 std::condition_variable_any&
113 return static_cast<std::condition_variable_any&
> (*this);
140 void unlock() noexcept { IMPL::unlock(); }
149 IMPL::wait (std::forward<PRED>(predicate));
152 template<
class DUR,
class PRED>
156 return IMPL::wait_for (timeout, std::forward<PRED> (predicate));
208 template<
class CONF = NonrecursiveLock_NoWait>
243 mon_.
wait (std::forward<PRED>(predicate));
246 template<
class DUR,
class PRED>
250 return mon_.
wait_for (timeout, std::forward<PRED> (predicate));
256 template<
class X,
class PRED>
262 mon_.
wait (std::forward<PRED>(predicate));
scoped guard to control the actual locking.
Lock(Monitor &m)
for creating a ClassLock
void wait(PRED &&predicate)
Monitor & accessMonitor()
subclass access to underlying sync primitives
bool wait_for(DUR const &timeout, PRED &&predicate)
Lock(X *it, PRED &&predicate)
convenience shortcut: Locks and immediately enters wait state on the given predicate
Facility for monitor object based locking.
static Monitor & getMonitor(Sync const *forThis)
Object Monitor for synchronisation and waiting.
void notify_all() noexcept
void wait(PRED &&predicate)
bool wait_for(DUR const &timeout, PRED &&predicate)
void notify_one() noexcept
Any copy and copy construction prohibited.
Lumiera error handling (C++ interface).
std::recursive_mutex RecursiveLock_NoWait
std::mutex NonrecursiveLock_NoWait
Implementation namespace for support and library code.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
void wait(PRED &&predicate)
bool wait_for(std::chrono::duration< REPR, PERI > const &timeout, PRED &&predicate)
std::condition_variable_any & condVar()
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...