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

Unified Diff: compiler/lib/implementation/isolate.dart

Issue 8457005: convert isolates to use Future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated co19 Created 9 years, 1 month 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 | « client/samples/dartcombat/state.dart ('k') | corelib/src/future.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/lib/implementation/isolate.dart
diff --git a/compiler/lib/implementation/isolate.dart b/compiler/lib/implementation/isolate.dart
index 704c5f009e287b7904d1f03e6cdafa803ea41b8b..a3586985f3a09631d752a4b12022f15059c0048d 100644
--- a/compiler/lib/implementation/isolate.dart
+++ b/compiler/lib/implementation/isolate.dart
@@ -153,15 +153,15 @@ class ReceivePortSingleShotImpl implements ReceivePort {
final String _SPAWNED_SIGNAL = "spawned";
class IsolateNatives {
- static Promise<SendPort> spawn(Isolate isolate, bool isLight) {
- Promise<SendPort> result = new Promise<SendPort>();
+ static Future<SendPort> spawn(Isolate isolate, bool isLight) {
+ Completer<SendPort> result = new Completer<SendPort>();
ReceivePort port = new ReceivePort.singleShot();
port.receive((msg, SendPort replyPort) {
assert(msg == _SPAWNED_SIGNAL);
result.complete(replyPort);
});
_spawn(isolate, isLight, port.toSendPort());
- return result;
+ return result.future;
}
static SendPort _spawn(Isolate isolate, bool light, SendPort port) native;
« no previous file with comments | « client/samples/dartcombat/state.dart ('k') | corelib/src/future.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698