Instance Method


Suspends the invocation of block objects on a dispatch object.


func suspend()



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


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.