3 #ifndef INCLUDE_NN_NLIB_THREADING_CONDVAR_H_
4 #define INCLUDE_NN_NLIB_THREADING_CONDVAR_H_
8 #include "nn/nlib/threading/CondVarFallback.h"
16 #ifndef NLIB_CONDVAR_USE_FALLBACK
36 #ifdef NLIB_CXX11_CONSTEXPR
63 template <
class lock_type>
71 template <
class lock_type>
74 return nlib_cond_wait_for(&m_Cond, detail::GetRawMutex(lock), timeout.ToTimeValue().tick);
76 template <
class lock_type>
80 datetime.ToTimeValue().tick);
89 inline errno_t CondVar::WaitFor(SimpleCriticalSection& lock,
91 NLIB_LOCK_REQUIRED(lock) {
92 return nlib_cond_wait_for(&m_Cond, detail::GetRawMutex(lock), timeout.ToTimeValue().tick);
96 inline errno_t CondVar::WaitUntil(SimpleCriticalSection& lock,
98 NLIB_LOCK_REQUIRED(lock) {
108 #endif // INCLUDE_NN_NLIB_THREADING_CONDVAR_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
void NotifyAll() noexcept
Signals all waiting threads.
void Notify() noexcept
Signals to at least one waiting thread.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Implements mutex, reentrant timeout mutex, and reentrant mutex.
Conditional variable for synchronization.
The class for representing the date and time.
errno_t Wait(lock_type &lock) noexcept
Waits.
constexpr CondVar() noexcept
Instantiates the object with default parameters (default constructor).
Defines the class for handling times and durations.
A file that contains the configuration information for each development environment.
errno_t WaitUntil(lock_type &lock, const nlib_ns::DateTime &datetime) noexcept
Waits with a timeout specified in date/time.
errno_t WaitFor(lock_type &lock, const nlib_ns::TimeSpan &timeout) noexcept
Waits with a specified timeout.
The class for representing the time.