<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Process/interrupt()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTask(im)interrupt"
  },
  "title" : "interrupt()"
}
-->

# interrupt()

Sends an interrupt signal to the receiver and all of its subtasks.

```
func interrupt()
```

## Discussion

If the task terminates as a result, which is the default behavior, an [`didTerminateNotification`](/documentation/Foundation/Process/didTerminateNotification) gets sent to the default notification center. This method has no effect if the receiver was already launched and has already finished executing. If the system hasn’t launched the receiver, this method raises an `NSInvalidArgumentException`.

It isn’t always possible to interrupt the receiver because it might be ignoring the interrupt signal. The [`interrupt()`](/documentation/Foundation/Process/interrupt()) method sends `SIGINT`.

---

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)