checkIfNeedEnqueue method Null safety

FutureOr checkIfNeedEnqueue(
  1. Lock lock,
  2. EnqueueCallback callback
)

Implementation

static FutureOr checkIfNeedEnqueue(Lock lock, EnqueueCallback callback) {
  if (lock.locked) {
    return lock.enqueue(callback);
  } else {
    return callback();
  }
}