Instance Method

suspend()

Suspends the invocation of block objects on a dispatch object.

Declaration

func suspend()

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 resume() decrements it. While the count is greater than zero, the object remains suspended, so you must balance each suspend() call with a matching 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

func activate()

Activates the dispatch object.

func resume()

Resumes the invocation of block objects on 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