synchronized<T> method

Future<T> synchronized<T>(
  1. Future<T> action()
)

Locked per instance unless in memory.

Implementation

Future<T> synchronized<T>(Future<T> Function() action) async {
  var path = (getPath() ?? getDatabase()?.path!)!;
  if (isInMemory(path)) {
    return await action();
  }
  return await (_MultiInstanceLocker(path).synchronized(action));
}