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

# break()

Forces the lock to be relinquished.

```
func `break`()
```

## Discussion

This method always succeeds unless the lock has been damaged. If another process has already unlocked or broken the lock, this method has no effect. You should generally use [`unlock()`](/documentation/Foundation/NSDistributedLock/unlock()) rather than [`break()`](/documentation/Foundation/NSDistributedLock/break()) to relinquish a lock.

> Warning:
> Because `breakLock` can release another process’s lock, it should be used with great caution.

Even if you break a lock, there’s no guarantee that you will then be able to acquire the lock—another process might get it before your [`try()`](/documentation/Foundation/NSDistributedLock/try()) is invoked.

Raises an `NSGenericException` if the lock could not be removed.

---

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)