release method

void release(
  1. LockGrant grant
)

Implementation

void release(LockGrant grant) {
  final lock = _locks[grant.table];
  if (lock == null) return;

  if (grant.mode == LockMode.read) {
    lock.readers = (lock.readers - 1).clamp(0, 999999);
    if (lock.readers == 0) lock.notifyNext();
  } else {
    lock.exclusive = false;
    lock.notifyAll();
  }
}