synchronized<T> abstract method
Runs computation holding the lock, released when it completes.
timeout bounds the wait for the lock as in acquire, computation is
then never called. Returns the value of computation and rethrows its
errors.
Implementation
Future<T> synchronized<T>(
FutureOr<T> Function() computation, {
Duration? timeout,
});