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

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

Issue 10536118: Create an initial port. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename __port to _lazy_port Created 8 years, 6 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 | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/isolate/frog/isolateimpl.dart
diff --git a/lib/isolate/frog/isolateimpl.dart b/lib/isolate/frog/isolateimpl.dart
index b66c5e299de547759645a0bded1de8afd2190536..f27fb2806dbaf67d6610136a1c87d87e2f119682 100644
--- a/lib/isolate/frog/isolateimpl.dart
+++ b/lib/isolate/frog/isolateimpl.dart
@@ -38,7 +38,13 @@ void _fillStatics(context) native @"""
$static_init();
""";
-ReceivePort _port;
+ReceivePort _lazy_port;
+ReceivePort get _port() {
+ if (_lazy_port === null) {
+ _lazy_port = new ReceivePort();
+ }
+ return _lazy_port;
+}
SendPort _spawnFunction(void topLevelFunction()) {
final name = _IsolateNatives._getJSFunctionName(topLevelFunction);
@@ -599,7 +605,7 @@ class _IsolateNatives {
static void _startIsolate2(Function topLevel, SendPort replyTo) {
_fillStatics(_globalState.currentContext);
- _port = new ReceivePort();
+ __port = new ReceivePort();
replyTo.send(_SPAWNED_SIGNAL, port.toSendPort());
topLevel();
}
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698