[#BloombergLP-bslmt-TimedCompletionGuard-2constructor-03] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/TimedCompletionGuard.adoc[TimedCompletionGuard]::TimedCompletionGuard :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bslmt_timedcompletionguard.h>` Create the guard. Optionally specify a `handler` function that is invoked when a `set` duration expires. If `handler` is not specified, `failByAbort` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslmt/TimedCompletionGuard/2constructor-02.adoc[TimedCompletionGuard](); ---- [.small]#xref:BloombergLP/bslmt/TimedCompletionGuard/2constructor-02.adoc[_» more..._]# Create the guard using the specified `basicAllocator` to supply memory. `failByAbort` is used when a set duration expires. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bslmt/TimedCompletionGuard/2constructor-0a.adoc[TimedCompletionGuard](xref:BloombergLP/bslmt/TimedCompletionGuard/allocator_type.adoc[allocator_type] const& basicAllocator); ---- [.small]#xref:BloombergLP/bslmt/TimedCompletionGuard/2constructor-0a.adoc[_» more..._]# Create the guard using the specified `function` handler invoked when a set duration expires. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslmt/TimedCompletionGuard/2constructor-0d.adoc[TimedCompletionGuard]( xref:BloombergLP/bslmt/TimedCompletionGuard/Handler.adoc[Handler] function, xref:BloombergLP/bslmt/TimedCompletionGuard/allocator_type.adoc[allocator_type] const& basicAllocator = allocator_type()); ---- [.small]#xref:BloombergLP/bslmt/TimedCompletionGuard/2constructor-0d.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#