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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1537543002: Fix for issue 25236 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 years 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/gc_marker.cc » ('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 a61715bf5d0a573b253b6e85b330e6dd4f4874c3..453baa9c17968456ab63c341d97cc871b537f5a2 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1311,7 +1311,9 @@ DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) {
if (iso->HasMutatorThread()) {
FATAL("Multiple mutators within one isolate is not supported.");
}
- Thread::EnterIsolate(iso);
+ if (!Thread::EnterIsolate(iso)) {
+ FATAL("Unable to Enter Isolate as Dart VM is shutting down");
+ }
}
@@ -1527,7 +1529,9 @@ DART_EXPORT Dart_Handle Dart_RunLoop() {
while (!data.done) {
ml.Wait();
}
- Thread::EnterIsolate(I);
+ if (!Thread::EnterIsolate(I)) {
+ FATAL("Inconsistent state, VM shutting down while in run loop.");
+ }
}
if (I->object_store()->sticky_error() != Object::null()) {
Dart_Handle error = Api::NewHandle(T, I->object_store()->sticky_error());
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/gc_marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698