lock<T> abstract method

Future<T> lock<T>(
  1. Future<T> callback(), {
  2. Future<void>? abortTrigger,
})

Runs callback in a critical section.

If abortTrigger completes before the critical section was entered, an AbortException is thrown and callback will not be invoked.

Implementation

Future<T> lock<T>(Future<T> Function() callback,
    {Future<void>? abortTrigger});