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

Unified Diff: runtime/bin/dbg_message.cc

Issue 629533002: Fix deadlock that can occur while handling service messages at a breakpoint. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | « no previous file | runtime/include/dart_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_message.cc
diff --git a/runtime/bin/dbg_message.cc b/runtime/bin/dbg_message.cc
index 30eb7307216ce8beefcf2187106acf4f098582a3..e50754402223887f4360a5b6c438f3caf0c959ee 100644
--- a/runtime/bin/dbg_message.cc
+++ b/runtime/bin/dbg_message.cc
@@ -1096,8 +1096,18 @@ void DbgMsgQueue::MessageLoop() {
while (true) {
// Handle all available vm service messages, up to a resume
// request.
- if (Dart_HandleServiceMessages()) {
- break;
+ while (Dart_HasServiceMessages()) {
+ // Release the message queue lock before handling service
+ // messages. This allows notifications to come in while we are
+ // processing long requests and avoids deadlock with the PortMap
+ // lock in the vm.
+ msg_queue_lock_.Exit();
+ bool resume = Dart_HandleServiceMessages();
+ msg_queue_lock_.Enter();
+ if (resume) {
+ // Resume requested through the vm service.
+ break;
+ }
}
// Handle all available debug messages, up to a resume request.
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698