Bitcoin Core  0.19.99
P2P Digital Currency
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Friends | 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]

Classes

class  reverse_lock
 An RAII-style reverse lock. More...
 

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

Protected Member Functions

 UniqueLock ()
 

Private Member Functions

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

Friends

class reverse_lock
 

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 121 of file sync.h.

Constructor & Destructor Documentation

◆ UniqueLock() [1/3]

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 147 of file sync.h.

◆ UniqueLock() [2/3]

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 155 of file sync.h.

◆ ~UniqueLock()

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

Definition at line 166 of file sync.h.

Here is the call graph for this function:

◆ UniqueLock() [3/3]

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

Definition at line 179 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 124 of file sync.h.

Here is the call graph for this function:

◆ operator bool()

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

Definition at line 172 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 137 of file sync.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ reverse_lock

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

Definition at line 210 of file sync.h.


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