13 template <Common::StdCompat::TimedMutex TIMED_MUTEX,
typename EXCEPTION>
16 if (not m.try_lock_until (Time::Pin2SafeSeconds (afterTickCount))) {
17 Throw (forward<EXCEPTION> (exception2Throw));
20 template <Common::StdCompat::TimedMutex TIMED_MUTEX>
23 if (not m.try_lock_until (Time::Pin2SafeSeconds (afterTickCount))) {
33 template <Common::StdCompat::TimedMutex TIMED_MUTEX,
typename EXCEPTION>
34 inline unique_lock<TIMED_MUTEX>
UniqueLock (TIMED_MUTEX& m,
const chrono::duration<double>& d, EXCEPTION&& exception2Throw)
36 unique_lock<TIMED_MUTEX> lock{m, d};
37 if (not lock.owns_lock ()) {
38 Throw (forward<EXCEPTION> (exception2Throw));
42 template <Common::StdCompat::TimedMutex TIMED_MUTEX>
43 inline unique_lock<TIMED_MUTEX>
UniqueLock (TIMED_MUTEX& m,
const chrono::duration<double>& d)
45 unique_lock<TIMED_MUTEX> lock{m, d};
46 if (not lock.owns_lock ()) {
time_point< RealtimeClock, DurationSeconds > TimePointSeconds
TimePointSeconds is a simpler approach to chrono::time_point, which doesn't require using templates e...
unique_lock< TIMED_MUTEX > UniqueLock(TIMED_MUTEX &m, const chrono::duration< double > &d, EXCEPTION &&exception2Throw)
void Throw(T &&e2Throw)
like the builtin C++ 'throw', but stamps in the current Activity context and does helpful,...
void TryLockUntil(TIMED_MUTEX &m, Time::TimePointSeconds afterTickCount, EXCEPTION &&exception2Throw)
void ThrowError(error_code ec)
throw a SystemErrorException with the given error_code - or std::bad_alloc for errc::not_enough_memor...