Constructors
Synopses
Declared in <semaphore_grant.h>
Constructs an empty grant that holds no semaphore slot.
CountingSemaphoreGrant() noexcept;
Copy construction is deleted; a grant uniquely owns its slot.
CountingSemaphoreGrant(CountingSemaphoreGrant const& other) = delete;
Move‐constructs a grant, transferring ownership of the held slot.
CountingSemaphoreGrant(CountingSemaphoreGrant&& other) noexcept;
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