[#CountingSemaphoreGrant-2constructor-02]
= xref:CountingSemaphoreGrant.adoc[CountingSemaphoreGrant]::CountingSemaphoreGrant
:relfileprefix: ../
:mrdocs:

Constructs a grant bound to a semaphore, optionally acquiring without blocking&period;

== Synopsis

Declared in `&lt;semaphore&lowbar;grant&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
CountingSemaphoreGrant(
    std::counting&lowbar;semaphore&lt;LeastMaxValue&gt;& sema,
    bool fTry = false) noexcept;
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sema*
| The semaphore to acquire a slot from&period;
| *fTry*
| If true, try to acquire without blocking&semi; otherwise block until acquired&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
