sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::SharedLockInt Class Reference

#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 ()
 

Detailed Description

Shared lock

Lock is acquired by constructor. For timed lock, waiting for longer than timeout, throws an exception.

Constructor & Destructor Documentation

◆ SharedLockInt() [1/2]

sptk::SharedLockInt::SharedLockInt ( SharedMutex &  mutex)
explicit

Constructor

Parameters
mutexShared mutex that controls lock

◆ SharedLockInt() [2/2]

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.

Parameters
mutexShared mutex that controls lock
timeoutLock timeout
fileSource file name where lock is attempted
lineSource file line number where lock is attempted

◆ ~SharedLockInt()

virtual sptk::SharedLockInt::~SharedLockInt ( )
inlinevirtual

Destructor Unlocks lock if it was acquired.


The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:44: SPTK 5.4.1