<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/DispatchObject/suspend()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "c:@F@dispatch_suspend"
  },
  "title" : "suspend()"
}
-->

# suspend()

Suspends the invocation of block objects on a dispatch object.

```
func suspend()
```

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

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

> Important:
> It is a programmer error to release an object that is currently suspended, because suspension implies that there is still work to be done. Therefore, always balance calls to this method with a corresponding call to ``doc://com.apple.dispatch/documentation/Dispatch/DispatchObject/resume()`` before disposing of the object. The behavior when releasing the last reference to a dispatch object while it is in a suspended state is undefined.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)