Initial commit

This commit is contained in:
admin1
2026-07-14 11:11:36 +08:00
commit 656499cf94
604 changed files with 119518 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import 'dart:async';
class AsyncLock {
Future<void>? _lastOp;
Future<T> run<T>(Future<T> Function() action) async {
final previous = _lastOp;
final completer = Completer<void>();
_lastOp = completer.future;
if (previous != null) {
await previous;
}
try {
return await action();
} finally {
completer.complete();
}
}
}