6#ifndef BITCOIN_SEMAPHORE_GRANT_H
7#define BITCOIN_SEMAPHORE_GRANT_H
12template <std::ptrdiff_t LeastMaxValue = std::counting_semaphore<>::max()>
16 std::counting_semaphore<LeastMaxValue>*
sem;
55 other.fHaveGrant =
false;
64 other.fHaveGrant =
false;
85 explicit operator bool() const noexcept
RAII-style semaphore lock.
CountingSemaphoreGrant() noexcept
CountingSemaphoreGrant(CountingSemaphoreGrant &&other) noexcept
CountingSemaphoreGrant & operator=(CountingSemaphoreGrant &&other) noexcept
std::counting_semaphore< LeastMaxValue > * sem
bool TryAcquire() noexcept
~CountingSemaphoreGrant()
CountingSemaphoreGrant(std::counting_semaphore< LeastMaxValue > &sema, bool fTry=false) noexcept
CountingSemaphoreGrant(const CountingSemaphoreGrant &)=delete
CountingSemaphoreGrant & operator=(const CountingSemaphoreGrant &)=delete
CountingSemaphoreGrant< 1 > BinarySemaphoreGrant