CountingSemaphoreGrant::CountingSemaphoreGrant

Constructs a grant bound to a semaphore, optionally acquiring without blocking.

Synopsis

Declared in <semaphore_grant.h>

explicit
CountingSemaphoreGrant(
    std::counting_semaphore<LeastMaxValue>& sema,
    bool fTry = false) noexcept;

Parameters

NameDescription
semaThe semaphore to acquire a slot from.
fTryIf true, try to acquire without blocking; otherwise block until acquired.