Bitcoin Core  27.99.0
P2P Digital Currency
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Friends | List of all members
UniqueLock< MutexType > Class Template Reference

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

#include <sync.h>

Inheritance diagram for UniqueLock< MutexType >:
[legend]
Collaboration diagram for UniqueLock< MutexType >:
[legend]

Classes

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

Public Member Functions

 UniqueLock (MutexType &mutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(mutexIn)
 
 UniqueLock (MutexType *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 Types

using Base = typename MutexType::unique_lock
 

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 MutexType>
class UniqueLock< MutexType >

Wrapper around std::unique_lock style lock for MutexType.

Definition at line 151 of file sync.h.

Member Typedef Documentation

◆ Base

template<typename MutexType >
using UniqueLock< MutexType >::Base = typename MutexType::unique_lock
private

Definition at line 154 of file sync.h.

Constructor & Destructor Documentation

◆ UniqueLock() [1/3]

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

Definition at line 177 of file sync.h.

◆ UniqueLock() [2/3]

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

Definition at line 185 of file sync.h.

◆ ~UniqueLock()

template<typename MutexType >
UniqueLock< MutexType >::~UniqueLock ( )
inline

Definition at line 196 of file sync.h.

Here is the call graph for this function:

◆ UniqueLock() [3/3]

template<typename MutexType >
UniqueLock< MutexType >::UniqueLock ( )
inlineprotected

Definition at line 209 of file sync.h.

Member Function Documentation

◆ Enter()

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

Definition at line 156 of file sync.h.

Here is the call graph for this function:

◆ operator bool()

template<typename MutexType >
UniqueLock< MutexType >::operator bool ( )
inline

Definition at line 202 of file sync.h.

◆ TryEnter()

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

Definition at line 166 of file sync.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ reverse_lock

template<typename MutexType >
friend class reverse_lock
friend

Definition at line 240 of file sync.h.


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