#include <Locks.h>
Public Member Functions | |
UniqueLockInt (SharedMutex &mutex) | |
UniqueLockInt (const UniqueLockInt &)=delete | |
UniqueLockInt (SharedMutex &mutex, std::chrono::milliseconds timeout, const char *file, size_t line) | |
virtual | ~UniqueLockInt () |
Unique lock
Lock is acquired by constructor. For timed lock, waiting for longer than timeout, throws an exception.
|
explicit |
Constructor Waits until lock is acquired.
mutex | Shared mutex that controls lock |
sptk::UniqueLockInt::UniqueLockInt | ( | SharedMutex & | mutex, |
std::chrono::milliseconds | timeout, | ||
const char * | file, | ||
size_t | line | ||
) |
Constructor Waits until lock is acquired, or until timeout, and then exception is thrown.
mutex | Shared mutex that controls lock |
timeout | Lock timeout |
file | Source file name where lock is attempted |
line | Source file line number where lock is attempted |
|
inlinevirtual |
Destructor Unlocks lock if it was acquired.