[#BloombergLP-bdlmt-TimerEventScheduler-cancelEvent-0b] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/TimerEventScheduler.adoc[TimerEventScheduler]::cancelEvent :relfileprefix: ../../../ :mrdocs: `cancelEvent` overloads == Synopses Declared in `<bdlmt_timereventscheduler.h>` Cancel the event having the specified `handle`. Optionally use the specified `key` to uniquely identify the event. If the optionally specified `wait` is true, then ensure that the dispatcher thread has resumed execution before returning. Return 0 on successful cancellation, and a non‐zero value if the `handle` is invalid _or_ if it is too late to cancel the event. If this method is being invoked from the dispatcher thread then the `wait` is ignored to avoid deadlock. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/bdlmt/TimerEventScheduler/cancelEvent-03.adoc[cancelEvent]( xref:BloombergLP/bdlmt/TimerEventScheduler/Handle.adoc[Handle] handle, bool wait = false); ---- [.small]#xref:BloombergLP/bdlmt/TimerEventScheduler/cancelEvent-03.adoc[_» more..._]# Same as the preceding overload, with the specified `key`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/bdlmt/TimerEventScheduler/cancelEvent-07.adoc[cancelEvent]( xref:BloombergLP/bdlmt/TimerEventScheduler/Handle.adoc[Handle] handle, xref:BloombergLP/bdlmt/TimerEventScheduler/EventKey.adoc[EventKey] const& key, bool wait = false); ---- [.small]#xref:BloombergLP/bdlmt/TimerEventScheduler/cancelEvent-07.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#