Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Unified Diff: lib/isolate/frog/isolateimpl.dart

Issue 9652001: SendPort + ReceivePort changes: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
});

Powered by Google App Engine
This is Rietveld 408576698