[#BloombergLP-bslmt-Once-cancel]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Once.adoc[Once]::cancel
:relfileprefix: ../../../
:mrdocs:

Revert this object to the state it was in before `enter` or `callOnce` was called, then unlock the internal mutex using the specified `onceLock` (possibly unblocking pending calls to `enter` or `callOnce`)&period; This method may only be used to cancel execution of one&hyphen;time code that has not yet completed&period; The behavior is undefined unless `onceLock` was locked by a matching call to `enter` on this object and has not been tampered&hyphen;with since (especially by calling `leave`)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
cancel(xref:BloombergLP/bslmt/Once/OnceLock.adoc[OnceLock]* onceLock);
----


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