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

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
Index: runtime/vm/message_handler.cc
diff --git a/runtime/vm/message_handler.cc b/runtime/vm/message_handler.cc
index 332a6e6ef12e1c9b4ddff96d80c69cffd2ca4fc5..45fb5643960a53fc45e3bd7a8f81bc82bbf3c3f8 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),
+ wedge_on_start_(false),
+ wedge_on_exit_(false),
+ wedged_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 (wedge_on_start()) {
+ HandleMessages(false, false);
+ if (wedge_on_start()) {
+ // Still wedged.
+ 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 (wedge_on_exit()) {
+ wedged_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;
+ wedged_on_exit_ = false;
}
- pool_ = NULL;
- run_end_callback = true;
}
}
if (run_end_callback && end_callback_ != NULL) {

Powered by Google App Engine
This is Rietveld 408576698