---
title: break()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsdistributedlock/break()
---

# break()

Forces the lock to be relinquished.

## Declaration

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

## Discussion

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() rather than 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() is invoked. Raises an NSGenericException if the lock could not be removed.

## See Also

### Relinquishing a Lock

- [unlock()](foundation/nsdistributedlock/unlock().md)
