CountingSemaphoreGrant::CountingSemaphoreGrant

Constructors

Synopses

Declared in <semaphore_grant.h>

Constructs an empty grant that holds no semaphore slot.

CountingSemaphoreGrant() noexcept;
» more...

Copy construction is deleted; a grant uniquely owns its slot.

CountingSemaphoreGrant(CountingSemaphoreGrant const& other) = delete;
» more...

Move-constructs a grant, transferring ownership of the held slot.

CountingSemaphoreGrant(CountingSemaphoreGrant&& other) noexcept;
» more...

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

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

Parameters

NameDescription
otherThe grant to move from; left empty afterwards.
semaThe semaphore to acquire a slot from.
fTryIf true, try to acquire without blocking; otherwise block until acquired.