mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
Inline non-functional type alias
Reason: b/195648511, non-functional type aliases are not supported by some internal infra Change-Id: I1c164f4ecf23ac22a36cabc630bf7e8f762d4849 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209541 Reviewed-by: Michal Terepeta <michalt@google.com> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
This commit is contained in:
parent
2e17bb219f
commit
dee7d252d4
|
@ -5,8 +5,6 @@
|
|||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
|
||||
typedef _LockRequest = Completer<void>;
|
||||
|
||||
/// Used to protect global state accessed in blocks containing calls to
|
||||
/// asynchronous methods.
|
||||
class Mutex {
|
||||
|
@ -30,7 +28,7 @@ class Mutex {
|
|||
_locked = true;
|
||||
return;
|
||||
}
|
||||
final request = _LockRequest();
|
||||
final request = Completer<void>();
|
||||
_outstandingRequests.add(request);
|
||||
await request.future;
|
||||
}
|
||||
|
@ -44,5 +42,5 @@ class Mutex {
|
|||
}
|
||||
|
||||
bool _locked = false;
|
||||
final _outstandingRequests = Queue<_LockRequest>();
|
||||
final _outstandingRequests = Queue<Completer<void>>();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue