|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Interface to allow synchronizing the access to derived classes between different threads by providing a mutex and a method to lock that mutex. Recursive locking is not allowed. More...
#include <Util.h>
Inheritance diagram for Util::ILockable:Static Public Attributes | |
| static constexpr std::chrono::milliseconds | DefaultTimeout = std::chrono::milliseconds(10) |
| Duration which is used as a default timeout within all methods of this class if no different duration is passed to them. | |
Protected Types | |
| using | MutexType = std::timed_mutex |
| using | LockType = std::unique_lock< MutexType > |
Protected Member Functions | |
| ILockable ()=default | |
| ~ILockable ()=default | |
| LockType | AcquireLock (const std::chrono::milliseconds Timeout=DefaultTimeout) const |
| Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded. | |
Protected Member Functions inherited from Util::INonCopyable | |
| constexpr | INonCopyable ()=default |
| ~INonCopyable ()=default | |
Private Attributes | |
| MutexType | LockMutex |
| Internal mutex used for locking. | |
Additional Inherited Members | |
Public Member Functions inherited from Util::INonCopyable | |
| INonCopyable (const INonCopyable &)=delete | |
| INonCopyable & | operator= (const INonCopyable &)=delete |
Interface to allow synchronizing the access to derived classes between different threads by providing a mutex and a method to lock that mutex. Recursive locking is not allowed.
|
protected |
|
protected |
|
protecteddefault |
|
protecteddefault |
|
protected |
Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded.
| Timeout | Time to wait trying to lock the internal mutex. 0 ms means that the functions waits for the mutex without timing out ever. |
| TimeoutException | is thrown if timeout duration is exceeded. |
|
staticconstexpr |
|
mutableprivate |