[#BloombergLP-bdlmt-EventScheduler-cancelEventAndWait-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/EventScheduler.adoc[EventScheduler]::cancelEventAndWait
:relfileprefix: ../../../
:mrdocs:

Cancel the event having the specified `handle` and release `&ast;handle`&period; Block until the event having `handle` (if it is valid) is either successfully canceled or dispatched before the call returns&period; Return 0 on successful cancellation, and a non&hyphen;zero value if `handle` is invalid _or_ if the event has already been dispatched or canceled&period; The behavior is undefined if this method is invoked from the dispatcher thread&period; Note that if the event is being executed when this method is invoked, this method will block until it is completed and then return a nonzero value&period; Also note that it is guaranteed that `&ast;handle` will be released whether this call is successful or not&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;eventscheduler&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
cancelEventAndWait(xref:BloombergLP/bdlmt/EventScheduler/EventHandle.adoc[EventHandle]* handle);
----


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