lock<T> abstract method

Future<T> lock<T>(
  1. Future<T> callback(), {
  2. Duration? timeout,
})

timeout is a timeout for acquiring the lock, not for the callback

Implementation

Future<T> lock<T>(Future<T> Function() callback, {Duration? timeout});