Function

dispatch_suspend

Suspends the invocation of block objects on a dispatch object.

Declaration

void dispatch_suspend(dispatch_object_t object);

Parameters

object

The dispatch queue or dispatch source to suspend. (You cannot suspend other types of dispatch objects.) This parameter cannot be NULL.

Discussion

By suspending a dispatch object, your application can temporarily prevent the execution of any blocks associated with that object. The suspension occurs after completion of any blocks running at the time of the call. Calling this function increments the suspension count of the object, and calling dispatch_resume decrements it. While the count is greater than zero, the object remains suspended, so you must balance each dispatch_suspend call with a matching dispatch_resume call.

Any blocks submitted to a dispatch queue or events observed by a dispatch source are delivered once the object is resumed.

See Also

Activating, Suspending, and Resuming the Object

dispatch_activate

Activates the dispatch object.

dispatch_resume

Resumes the invocation of block objects on a dispatch object.

dispatch_object_t

A dispatch object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software