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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1427583009: 1. Get rid of SwitchIsolateScope as it is not clear when this should be used and there is also a bu… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index f25747cdd707c74414acb52d4c3e7951e379e94c..bd24209a73f60daf4f9d09483ed6512e37d5c98c 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1664,8 +1664,9 @@ DART_EXPORT Dart_Handle Dart_RunLoop() {
Monitor monitor;
MonitorLocker ml(&monitor);
{
- SwitchIsolateScope switch_scope(NULL);
-
+ // The message handler run loop does not expect to have a current isolate
+ // so we exit the isolate here and enter it again after the runloop is done.
+ Thread::ExitIsolate();
RunLoopData data;
data.monitor = &monitor;
data.done = false;
@@ -1675,6 +1676,7 @@ DART_EXPORT Dart_Handle Dart_RunLoop() {
while (!data.done) {
ml.Wait();
}
+ Thread::EnterIsolate(I);
}
if (I->object_store()->sticky_error() != Object::null()) {
Dart_Handle error = Api::NewHandle(I, I->object_store()->sticky_error());
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698