Stop using a port to keep the isolate alive in async_helper.

Addresses issue #33067.

Bug: http://dartbug.com/33067
Change-Id: Id9e60e930a8f289a51063f609e13fb998f6907c3
Reviewed-on: https://dart-review.googlesource.com/55662
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
This commit is contained in:
Lasse R.H. Nielsen
2018-05-18 09:33:27 +00:00
committed by commit-bot@chromium.org
parent a16563931c
commit dc76aa34c7
-10
View File
@@ -23,14 +23,7 @@
library async_helper;
// TODO(kustermann): This is problematic because we rely on a working
// 'dart:isolate' (i.e. it is in particular problematic with dart2js).
// It would be nice if we could use a different mechanism for different
// runtimes.
import 'dart:isolate';
bool _initialized = false;
ReceivePort _port = null;
int _asyncLevel = 0;
Exception _buildException(String msg) {
@@ -49,7 +42,6 @@ void asyncStart([int count = 1]) {
if (!_initialized) {
print('unittest-suite-wait-for-done');
_initialized = true;
_port = new ReceivePort();
}
_asyncLevel += count;
}
@@ -66,8 +58,6 @@ void asyncEnd() {
}
_asyncLevel--;
if (_asyncLevel == 0) {
_port.close();
_port = null;
print('unittest-suite-success');
}
}