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

Unified Diff: runtime/bin/io_service_patch.dart

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 7 years, 2 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
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | sdk/lib/isolate/isolate.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/io_service_patch.dart
diff --git a/runtime/bin/io_service_patch.dart b/runtime/bin/io_service_patch.dart
index c6a703529cf9fd67fe50451879e337ca6c48ae44..8f5a593055d923a75c26941b1f75f1a34000dbe4 100644
--- a/runtime/bin/io_service_patch.dart
+++ b/runtime/bin/io_service_patch.dart
@@ -30,13 +30,14 @@ patch class _IOService {
}
if (_receivePort == null) {
_receivePort = new ReceivePort();
- _replyToPort = _receivePort.toSendPort();
- _receivePort.receive((data, _) {
+ _replyToPort = _receivePort.sendPort;
+ StreamSubscription subscription;
+ subscription = _receivePort.listen((data) {
assert(data is List && data.length == 2);
_messageMap.remove(data[0]).complete(data[1]);
if (_messageMap.length == 0) {
_id = 0;
- _receivePort.close();
+ subscription.cancel();
_receivePort = null;
}
});
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | sdk/lib/isolate/isolate.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698