release method

Future<void> release()

Release the lock. Safe to call when nothing was acquired.

Implementation

Future<void> release() async {
  final raf = _raf;
  if (raf == null) return;
  _raf = null;
  _processHeld.remove(_canonical(lockPath));
  try {
    await raf.unlock();
  } catch (_) {/* ignore */}
  try {
    await raf.close();
  } catch (_) {/* ignore */}
}