synchronized<T> abstract method
Executes computation
when lock is available.
Only one asynchronous block can run while the lock is retained.
If timeout
is specified, it will try to grab the lock and will not
call the computation callback and throw a TimeoutExpection
is the lock
cannot be grabbed in the given duration.
Implementation
Future<T> synchronized<T>(FutureOr<T> Function() computation,
{Duration? timeout});