Constructors

Synopses

Declared in <semaphore_grant.h>

Constructs an empty grant that holds no semaphore slot.

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

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

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

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

Parameters

Name

Description

other

The grant to move from; left empty afterwards.

sema

The semaphore to acquire a slot from.

fTry

If true, try to acquire without blocking; otherwise block until acquired.

Created with MrDocs