BloombergLP::bdlmt::EventScheduler::cancelEventAndWait

Cancel the event referred to by handle, release it, and wait.

Synopsis

Declared in <bdlmt_eventscheduler.h>

int
cancelEventAndWait(EventHandle* handle);

Description

Cancel the event having the specified handle and release *handle. Block until the event having handle (if it is valid) is either successfully canceled or dispatched before the call returns. Return 0 on successful cancellation, and a non-zero value if handle is invalid or if the event has already been dispatched or canceled. The behavior is undefined if this method is invoked from the dispatcher thread. 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. Also note that it is guaranteed that *handle will be released whether this call is successful or not.

Return Value

0 on successful cancellation, and a non-zero value otherwise

Parameters

NameDescription
handleevent handle to cancel and release