Suspends the invocation of block objects on a dispatch object.
- iOS 4.0+
- macOS 10.6+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The dispatch queue or dispatch source to suspend. (You cannot suspend other types of dispatch objects.) This parameter cannot be
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 decrements it. While the count is greater than zero, the object remains suspended, so you must balance each
dispatch call with a matching
Any blocks submitted to a dispatch queue or events observed by a dispatch source are delivered once the object is resumed.