Bitcoin Core  0.18.99
P2P Digital Currency
Public Member Functions | Private Member Functions | List of all members
UniqueLock< Mutex, Base > Class Template Reference

Wrapper around std::unique_lock style lock for Mutex. More...

#include <sync.h>

Inheritance diagram for UniqueLock< Mutex, Base >:
[legend]
Collaboration diagram for UniqueLock< Mutex, Base >:
[legend]

Public Member Functions

 UniqueLock (Mutex &mutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(mutexIn)
 
 UniqueLock (Mutex *pmutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(pmutexIn)
 
 ~UniqueLock () UNLOCK_FUNCTION()
 
 operator bool ()
 

Private Member Functions

void Enter (const char *pszName, const char *pszFile, int nLine)
 
bool TryEnter (const char *pszName, const char *pszFile, int nLine)
 

Detailed Description

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
class UniqueLock< Mutex, Base >

Wrapper around std::unique_lock style lock for Mutex.

Definition at line 119 of file sync.h.

Constructor & Destructor Documentation

◆ UniqueLock() [1/2]

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
UniqueLock< Mutex, Base >::UniqueLock ( Mutex mutexIn,
const char *  pszName,
const char *  pszFile,
int  nLine,
bool  fTry = false 
)
inline

Definition at line 145 of file sync.h.

◆ UniqueLock() [2/2]

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
UniqueLock< Mutex, Base >::UniqueLock ( Mutex pmutexIn,
const char *  pszName,
const char *  pszFile,
int  nLine,
bool  fTry = false 
)
inline

Definition at line 153 of file sync.h.

◆ ~UniqueLock()

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
UniqueLock< Mutex, Base >::~UniqueLock ( )
inline

Definition at line 164 of file sync.h.

Member Function Documentation

◆ Enter()

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
void UniqueLock< Mutex, Base >::Enter ( const char *  pszName,
const char *  pszFile,
int  nLine 
)
inlineprivate

Definition at line 122 of file sync.h.

◆ operator bool()

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
UniqueLock< Mutex, Base >::operator bool ( )
inline

Definition at line 170 of file sync.h.

◆ TryEnter()

template<typename Mutex, typename Base = typename Mutex::UniqueLock>
bool UniqueLock< Mutex, Base >::TryEnter ( const char *  pszName,
const char *  pszFile,
int  nLine 
)
inlineprivate

Definition at line 135 of file sync.h.


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