Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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 ()=default

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

Member Typedef Documentation

◆ Base

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

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

Here is the call graph for this function:

◆ ~UniqueLock()

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

Definition at line 190 of file sync.h.

Here is the call graph for this function:

◆ UniqueLock() [3/3]

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

Member Function Documentation

◆ Enter()

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

Definition at line 150 of file sync.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator bool()

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

Definition at line 196 of file sync.h.

◆ TryEnter()

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

Definition at line 160 of file sync.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reverse_lock

template<typename MutexType>
friend class reverse_lock
friend

Definition at line 237 of file sync.h.


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