Index: lib/isolate/frog/isolateimpl.dart |
diff --git a/lib/isolate/frog/isolateimpl.dart b/lib/isolate/frog/isolateimpl.dart |
index 2e096fc7776c8617eac806a0c62cb413ff4c5557..bc7267c10b5fb4dec57ac913beba79c5ef227889 100644 |
--- a/lib/isolate/frog/isolateimpl.dart |
+++ b/lib/isolate/frog/isolateimpl.dart |
@@ -293,8 +293,9 @@ class _IsolateNatives { |
/** JavaScript-specific implementation to spawn an isolate. */ |
static Future<SendPort> spawn(Isolate isolate, bool isLight) { |
Completer<SendPort> completer = new Completer<SendPort>(); |
- ReceivePort port = new ReceivePort.singleShot(); |
+ ReceivePort port = new ReceivePort(); |
port.receive((msg, SendPort replyPort) { |
+ port.close(); |
eub
2012/03/09 18:33:10
I wonder how often people are going to write this
eub
2012/03/09 18:33:10
I saw about a dozen instances looking over this CL
Siggi Cherem (dart-lang)
2012/03/10 03:10:00
Yeah - this is something that I saw commonly in te
|
assert(msg == _SPAWNED_SIGNAL); |
completer.complete(replyPort); |
}); |
@@ -543,8 +544,9 @@ class _IsolateNatives { |
static _spawn2(String functionName, String uri, bool isLight) { |
Completer<SendPort> completer = new Completer<SendPort>(); |
- ReceivePort port = new ReceivePort.singleShot(); |
+ ReceivePort port = new ReceivePort(); |
port.receive((msg, SendPort replyPort) { |
+ port.close(); |
assert(msg == _SPAWNED_SIGNAL); |
completer.complete(replyPort); |
}); |