Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CountingSemaphoreGrant< LeastMaxValue > Class Template Reference

RAII-style semaphore lock. More...

#include <semaphore_grant.h>

Public Member Functions

void Acquire () noexcept
void Release () noexcept
bool TryAcquire () noexcept
 CountingSemaphoreGrant (const CountingSemaphoreGrant &)=delete
CountingSemaphoreGrantoperator= (const CountingSemaphoreGrant &)=delete
 CountingSemaphoreGrant (CountingSemaphoreGrant &&other) noexcept
CountingSemaphoreGrantoperator= (CountingSemaphoreGrant &&other) noexcept
 CountingSemaphoreGrant () noexcept
 CountingSemaphoreGrant (std::counting_semaphore< LeastMaxValue > &sema, bool fTry=false) noexcept
 ~CountingSemaphoreGrant ()
 operator bool () const noexcept

Private Attributes

std::counting_semaphore< LeastMaxValue > * sem
bool fHaveGrant

Detailed Description

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
class CountingSemaphoreGrant< LeastMaxValue >

RAII-style semaphore lock.

Definition at line 13 of file semaphore_grant.h.

Constructor & Destructor Documentation

◆ CountingSemaphoreGrant() [1/4]

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant< LeastMaxValue >::CountingSemaphoreGrant ( const CountingSemaphoreGrant< LeastMaxValue > & )
delete

◆ CountingSemaphoreGrant() [2/4]

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant< LeastMaxValue >::CountingSemaphoreGrant ( CountingSemaphoreGrant< LeastMaxValue > && other)
inlinenoexcept

Definition at line 51 of file semaphore_grant.h.

◆ CountingSemaphoreGrant() [3/4]

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant< LeastMaxValue >::CountingSemaphoreGrant ( )
inlinenoexcept

Definition at line 69 of file semaphore_grant.h.

◆ CountingSemaphoreGrant() [4/4]

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant< LeastMaxValue >::CountingSemaphoreGrant ( std::counting_semaphore< LeastMaxValue > & sema,
bool fTry = false )
inlineexplicitnoexcept

Definition at line 71 of file semaphore_grant.h.

◆ ~CountingSemaphoreGrant()

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant< LeastMaxValue >::~CountingSemaphoreGrant ( )
inline

Definition at line 80 of file semaphore_grant.h.

Member Function Documentation

◆ Acquire()

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
void CountingSemaphoreGrant< LeastMaxValue >::Acquire ( )
inlinenoexcept

Definition at line 20 of file semaphore_grant.h.

◆ operator bool()

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant< LeastMaxValue >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 85 of file semaphore_grant.h.

◆ operator=() [1/2]

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant & CountingSemaphoreGrant< LeastMaxValue >::operator= ( const CountingSemaphoreGrant< LeastMaxValue > & )
delete

◆ operator=() [2/2]

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
CountingSemaphoreGrant & CountingSemaphoreGrant< LeastMaxValue >::operator= ( CountingSemaphoreGrant< LeastMaxValue > && other)
inlinenoexcept

Definition at line 59 of file semaphore_grant.h.

◆ Release()

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
void CountingSemaphoreGrant< LeastMaxValue >::Release ( )
inlinenoexcept

Definition at line 29 of file semaphore_grant.h.

◆ TryAcquire()

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
bool CountingSemaphoreGrant< LeastMaxValue >::TryAcquire ( )
inlinenoexcept

Definition at line 38 of file semaphore_grant.h.

Member Data Documentation

◆ fHaveGrant

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
bool CountingSemaphoreGrant< LeastMaxValue >::fHaveGrant
private

Definition at line 17 of file semaphore_grant.h.

◆ sem

template<std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
std::counting_semaphore<LeastMaxValue>* CountingSemaphoreGrant< LeastMaxValue >::sem
private

Definition at line 16 of file semaphore_grant.h.


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