[#CountingSemaphoreGrant]
= CountingSemaphoreGrant
:mrdocs:

RAII&hyphen;style semaphore lock

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::ptrdiff&lowbar;t LeastMaxValue = std&colon;&colon;counting&lowbar;semaphore&lt;&gt;&colon;&colon;max()&gt;
class CountingSemaphoreGrant;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CountingSemaphoreGrant/2constructor-04.adoc[`CountingSemaphoreGrant`]         [.small]#[constructor]#
| Constructors
| xref:CountingSemaphoreGrant/2destructor.adoc[`&#126;CountingSemaphoreGrant`] [.small]#[destructor]#
| Releases the held slot, if any, on destruction&period;
| xref:CountingSemaphoreGrant/operator_assign-09.adoc[`operator&equals;`] 
| Assignment operators
| xref:CountingSemaphoreGrant/Acquire.adoc[`Acquire`] 
| Acquires the semaphore, blocking until a slot is available&period;
| xref:CountingSemaphoreGrant/Release.adoc[`Release`] 
| Releases the held semaphore slot, if any&period;
| xref:CountingSemaphoreGrant/TryAcquire.adoc[`TryAcquire`] 
| Attempts to acquire the semaphore without blocking&period;
| xref:CountingSemaphoreGrant/2conversion.adoc[`operator bool`] 
| Reports whether this grant currently holds a semaphore slot&period;
|===



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