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

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

Detailed Description

Unique lock

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

Constructor & Destructor Documentation

◆ UniqueLockInt() [1/2]

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

Constructor Waits until lock is acquired.

Parameters
mutexShared mutex that controls lock

◆ UniqueLockInt() [2/2]

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.

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

◆ ~UniqueLockInt()

virtual sptk::UniqueLockInt::~UniqueLockInt ( )
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:47: SPTK 5.4.1