release method

  1. @override
Future<bool> release(
  1. String key,
  2. String owner
)
override

Releases the lock if the requesting owner matches.

Implementation

@override
/// Releases the lock if the requesting [owner] matches.
Future<bool> release(String key, String owner) async {
  final lock = _locks[key];
  if (lock == null) {
    return false;
  }
  if (lock.owner != owner) {
    return false;
  }
  _locks.remove(key);
  return true;
}