dispatch_block_cancel

Function dispatch_block_cancel 

Source
pub unsafe extern "C" fn dispatch_block_cancel(
    block: dispatch_block_t,
)
Expand description

Asynchronously cancel the specified dispatch block object.

Cancellation causes any future execution of the dispatch block object to return immediately, but does not affect any execution of the block object that is already in progress.

Release of any resources associated with the block object will be delayed until execution of the block object is next attempted (or any execution already in progress completes).

NOTE: care needs to be taken to ensure that a block object that may be canceled does not capture any resources that require execution of the block body in order to be released (e.g. memory allocated with malloc(3) that the block body calls free(3) on). Such resources will be leaked if the block body is never executed due to cancellation.

Parameter block: The dispatch block object to cancel. The result of passing NULL or a block object not returned by one of the dispatch_block_create* functions is undefined.