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

Unified Diff: runtime/vm/message_handler.cc

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/message_handler.h ('k') | runtime/vm/service.h » ('j') | 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 6ca2fb1994db843261180c0369a2d439cd899340..27641d054d22d211c62dbb63f16e6026d46df5e6 100644
--- a/runtime/vm/message_handler.cc
+++ b/runtime/vm/message_handler.cc
@@ -38,6 +38,7 @@ MessageHandler::MessageHandler()
paused_(0),
pause_on_start_(false),
pause_on_exit_(false),
+ paused_on_start_(false),
paused_on_exit_(false),
pool_(NULL),
task_(NULL),
@@ -225,11 +226,17 @@ void MessageHandler::TaskCallback() {
// if we have one. For an isolate, this will run the isolate's
// main() function.
if (pause_on_start()) {
+ if (!paused_on_start_) {
+ NotifyPauseOnStart();
+ paused_on_start_ = true;
+ }
HandleMessages(false, false);
if (pause_on_start()) {
// Still paused.
task_ = NULL; // No task in queue.
return;
+ } else {
+ paused_on_start_ = false;
}
}
@@ -251,11 +258,14 @@ void MessageHandler::TaskCallback() {
if (!ok || !HasLivePorts()) {
if (pause_on_exit()) {
- if (FLAG_trace_service_pause_events && !paused_on_exit_) {
- OS::PrintErr("Isolate %s paused before exiting. "
+ if (!paused_on_exit_) {
+ if (FLAG_trace_service_pause_events) {
+ OS::PrintErr("Isolate %s paused before exiting. "
"Use the Observatory to release it.\n", name());
+ }
+ NotifyPauseOnExit();
+ paused_on_exit_ = true;
}
- paused_on_exit_ = true;
} else {
if (FLAG_trace_isolates) {
OS::Print("[-] Stopping message handler (%s):\n"
« no previous file with comments | « runtime/vm/message_handler.h ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698