1#ifndef TENDUKE_CONCURRENT_GUARDWITHTIMEOUT_H
2#define TENDUKE_CONCURRENT_GUARDWITHTIMEOUT_H
8namespace tenduke {
namespace concurrent {
14template <
typename TIMED_MUTEX>
24 : mutex(mutex), timedout(false)
26 if (!mutex.try_lock_for(timeout)) {
A mutex-guard with timeout functionality.
Definition GuardWithTimeout.h:16
GuardWithTimeout(TIMED_MUTEX &mutex, std::chrono::milliseconds timeout)
Constructs new instance: Tries to lock the mutex.
Definition GuardWithTimeout.h:23
bool hasTimedout() const
Checks if the guard failed beaause of timeout.
Definition GuardWithTimeout.h:42
GuardWithTimeout< std::recursive_timed_mutex > RecursiveGuardWithTimeout
Recursive implementation of GuardWithTimeout.
Definition GuardWithTimeout.h:55
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4