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

Unified Diff: sdk/lib/_internal/lib/isolate_helper.dart

Issue 207853003: Don't try to infer that the current isolate is executing an event. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug print. Created 6 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
« no previous file with comments | « no previous file | tests/isolate/ping_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/isolate_helper.dart
diff --git a/sdk/lib/_internal/lib/isolate_helper.dart b/sdk/lib/_internal/lib/isolate_helper.dart
index e0512edd445c5c46b51ce7bbb90c300aea000213..9245d07bae5e092ba92b947cac2b4a7c7e35e7bf 100644
--- a/sdk/lib/_internal/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/lib/isolate_helper.dart
@@ -288,6 +288,7 @@ class _IsolateContext implements IsolateContext {
* event queue is paused.
*/
var _scheduledControlEvents;
+ bool _isExecutingEvent = false;
/** Whether errors are considered fatal. */
// This doesn't do anything yet. We need to be able to catch uncaught errors
@@ -343,7 +344,7 @@ class _IsolateContext implements IsolateContext {
void handlePing(SendPort responsePort, int pingType) {
if (pingType == Isolate.IMMEDIATE ||
(pingType == Isolate.BEFORE_NEXT_EVENT &&
- !identical(_globalState.currentContext, this))) {
+ !_isExecutingEvent)) {
responsePort.send(null);
return;
}
@@ -363,7 +364,7 @@ class _IsolateContext implements IsolateContext {
if (this.terminateCapability != authentification) return;
if (priority == Isolate.IMMEDIATE ||
(priority == Isolate.BEFORE_NEXT_EVENT &&
- !identical(_globalState.currentContext, this))) {
+ !_isExecutingEvent)) {
kill();
return;
}
@@ -386,9 +387,11 @@ class _IsolateContext implements IsolateContext {
_globalState.currentContext = this;
this._setGlobals();
var result = null;
+ _isExecutingEvent = true;
try {
result = code();
} finally {
+ _isExecutingEvent = false;
_globalState.currentContext = old;
if (old != null) old._setGlobals();
if (_scheduledControlEvents != null) {
« no previous file with comments | « no previous file | tests/isolate/ping_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698