release method

void release()

Lets the next change in: removes the lock, if it is still this one.

Implementation

void release() {
  _beat?.cancel();
  _beat = null;
  try {
    if (_tokenOf(_file.readAsStringSync()) != _token) return;
    retryOnLock(_file.deleteSync);
  } on FileSystemException {
    // Already gone, or can't be removed: it goes stale on its own.
  }
}