[#BloombergLP-bslmt-FastPostSemaphore-take]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/FastPostSemaphore.adoc[FastPostSemaphore]::take
:relfileprefix: ../../../
:mrdocs:

Take up to `maximumToTake` units from this semaphore&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;fastpostsemaphore&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
take(int maximumToTake);
----

== Description

If the count of this semaphore is positive, reduce the count by the lesser of the count and the specified `maximumToTake` and return the magnitude of the change to the count&period; Otherwise, do nothing and return 0&period;

== Return Value

number of units taken, or 0 if the count was not positive

== Parameters

[cols="1,4"]
|===
| Name| Description
| *maximumToTake*
| maximum number of units to take from the count
|===


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