Move code that sends an isolate shutdown message to the service isolate to the block after we transition the thread state to ThreadInVM.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2047123002 .
This commit is contained in:
Siva Annamalai 2016-06-07 17:04:04 -07:00
parent 055231cee0
commit 6b9581e228
2 changed files with 7 additions and 7 deletions

View file

@ -655,7 +655,6 @@ void Dart::RunShutdownCallback() {
Isolate* isolate = Isolate::Current();
void* callback_data = isolate->init_callback_data();
Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback();
ServiceIsolate::SendIsolateShutdownMessage();
if (callback != NULL) {
(callback)(callback_data);
}

View file

@ -1297,13 +1297,14 @@ DART_EXPORT void Dart_ShutdownIsolate() {
StackZone zone(T);
HandleScope handle_scope(T);
Dart::RunShutdownCallback();
// The Thread structure is disassociated from the isolate, we do the
// safepoint transition explicity here instead of using the TransitionXXX
// scope objects as the original transition happened outside this scope in
// Dart_EnterIsolate/Dart_CreateIsolate.
T->ExitSafepoint();
T->set_execution_state(Thread::kThreadInVM);
ServiceIsolate::SendIsolateShutdownMessage();
}
// The Thread structure is disassociated from the isolate, we do the
// safepoint transition explicity here instead of using the TransitionXXX
// scope objects as the original transition happened outside this scope in
// Dart_EnterIsolate/Dart_CreateIsolate.
T->ExitSafepoint();
T->set_execution_state(Thread::kThreadInVM);
Dart::ShutdownIsolate();
}