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

Unified Diff: runtime/vm/message_handler.cc

Issue 3006743003: Restore "Avoid to run dart code during paused_on_exit" (Closed)
Patch Set: Created 3 years, 4 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/observatory/tests/service/issue_30555_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message_handler.cc
diff --git a/runtime/vm/message_handler.cc b/runtime/vm/message_handler.cc
index 3990b5795a8a93ef441b521adfebdfe4ac35694f..a6d7da81957f28f95736193f94e93155ea721c51 100644
--- a/runtime/vm/message_handler.cc
+++ b/runtime/vm/message_handler.cc
@@ -346,7 +346,18 @@ void MessageHandler::TaskCallback() {
PausedOnStartLocked(&ml, false);
}
}
-#endif
+ if (is_paused_on_exit()) {
+ status = HandleMessages(&ml, false, false);
+ if (ShouldPauseOnExit(status)) {
+ // Still paused.
+ ASSERT(oob_queue_->IsEmpty());
+ task_ = NULL; // No task in queue.
+ return;
+ } else {
+ PausedOnExitLocked(&ml, false);
+ }
+ }
+#endif // !defined(PRODUCT)
if (status == kOK) {
if (start_callback_) {
@@ -373,17 +384,15 @@ void MessageHandler::TaskCallback() {
if (status != kOK || !HasLivePorts()) {
#if !defined(PRODUCT)
if (ShouldPauseOnExit(status)) {
- if (!is_paused_on_exit()) {
- if (FLAG_trace_service_pause_events) {
- OS::PrintErr(
- "Isolate %s paused before exiting. "
- "Use the Observatory to release it.\n",
- name());
- }
- PausedOnExitLocked(&ml, true);
- // More messages may have come in while we released the monitor.
- status = HandleMessages(&ml, false, false);
+ if (FLAG_trace_service_pause_events) {
+ OS::PrintErr(
+ "Isolate %s paused before exiting. "
+ "Use the Observatory to release it.\n",
+ name());
}
+ PausedOnExitLocked(&ml, true);
+ // More messages may have come in while we released the monitor.
+ status = HandleMessages(&ml, false, false);
if (ShouldPauseOnExit(status)) {
// Still paused.
ASSERT(oob_queue_->IsEmpty());
« no previous file with comments | « runtime/observatory/tests/service/issue_30555_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698