[#BloombergLP-bslmt-TimedCompletionGuard-2constructor-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/TimedCompletionGuard.adoc[TimedCompletionGuard]::TimedCompletionGuard
:relfileprefix: ../../../
:mrdocs:

Create a timed completion guard that invokes `function` on expiration&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
TimedCompletionGuard(
    xref:BloombergLP/bslmt/TimedCompletionGuard/Handler.adoc[Handler] function,
    xref:BloombergLP/bslmt/TimedCompletionGuard/allocator_type.adoc[allocator&lowbar;type] const& basicAllocator = allocator&lowbar;type());
----

== Description

Create the guard using the specified `function` handler invoked when a set duration expires&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the currently installed default allocator is used&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *function*
| handler invoked when a set duration expires
| *basicAllocator*
| allocator used to supply memory
|===


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