[#BloombergLP-bslmt-TimedCompletionGuard-guard] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/TimedCompletionGuard.adoc[TimedCompletionGuard]::guard :relfileprefix: ../../../ :mrdocs: Configure a thread to, at the expiration of the specified `duration`, invoke the handler assigned at object creation with the specified `text`, unless the `release` method is invoked or this guard is rescheduled with a subsequent call to `guard`. Return 0 on success, and a non‐zero value if a thread is not available and could not be created. The behavior is undefined unless `duration` is a positive value. == Synopsis Declared in `<bslmt_timedcompletionguard.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int guard( xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& duration, std::string_view const& text); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#