Future<void> lock(FutureOr<void> Function() action) async { await acquire(); try { await action(); } finally { await release(); } }