|
#include <Locks.h>
Public Member Functions | |
| SharedLockInt (SharedMutex &mutex) | |
| SharedLockInt (SharedMutex &mutex, std::chrono::milliseconds timeout, const char *file, size_t line) | |
| SharedLockInt (const SharedLockInt &)=delete | |
| virtual | ~SharedLockInt () |
Shared lock
Lock is acquired by constructor. For timed lock, waiting for longer than timeout, throws an exception.
|
explicit |
Constructor
| mutex | Shared mutex that controls lock |
| sptk::SharedLockInt::SharedLockInt | ( | 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.