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

Unified Diff: runtime/vm/message_handler.cc

Issue 204003002: Support wedging isolates before startup or before exit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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.cc » ('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 332a6e6ef12e1c9b4ddff96d80c69cffd2ca4fc5..d76e06082046e882e9c70adda218b3ce062cc6cc 100644
--- a/runtime/vm/message_handler.cc
+++ b/runtime/vm/message_handler.cc
@@ -34,6 +34,9 @@ MessageHandler::MessageHandler()
oob_queue_(new MessageQueue()),
control_ports_(0),
live_ports_(0),
+ pause_on_start_(false),
+ pause_on_exit_(false),
+ paused_on_exit_(false),
pool_(NULL),
task_(NULL),
start_callback_(NULL),
@@ -197,6 +200,15 @@ void MessageHandler::TaskCallback() {
// Initialize the message handler by running its start function,
// if we have one. For an isolate, this will run the isolate's
// main() function.
+ if (pause_on_start()) {
+ HandleMessages(false, false);
+ if (pause_on_start()) {
+ // Still paused.
+ task_ = NULL; // No task in queue.
+ return;
+ }
+ }
+
if (start_callback_) {
monitor_.Exit();
ok = start_callback_(callback_data_);
@@ -212,14 +224,19 @@ void MessageHandler::TaskCallback() {
task_ = NULL; // No task in queue.
if (!ok || !HasLivePorts()) {
- if (FLAG_trace_isolates) {
+ if (pause_on_exit()) {
+ paused_on_exit_ = true;
+ } else {
+ if (FLAG_trace_isolates) {
OS::Print("[-] Stopping message handler (%s):\n"
"\thandler: %s\n",
(ok ? "no live ports" : "error"),
name());
+ }
+ pool_ = NULL;
+ run_end_callback = true;
+ paused_on_exit_ = false;
}
- pool_ = NULL;
- run_end_callback = true;
}
}
if (run_end_callback && end_callback_ != NULL) {
« no previous file with comments | « runtime/vm/message_handler.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698