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

Side by Side Diff: runtime/bin/dbg_message.cc

Issue 995883002: Yesterday's deadlock fix was wrong. It could drop notifications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/dbg_connection.h" 5 #include "bin/dbg_connection.h"
6 #include "bin/dbg_message.h" 6 #include "bin/dbg_message.h"
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "bin/lockers.h" 8 #include "bin/lockers.h"
9 #include "bin/thread.h" 9 #include "bin/thread.h"
10 #include "bin/utils.h" 10 #include "bin/utils.h"
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 is_running_ = false; 1090 is_running_ = false;
1091 1091
1092 // Request notification on isolate messages. This allows us to 1092 // Request notification on isolate messages. This allows us to
1093 // respond to vm service messages while at breakpoint. 1093 // respond to vm service messages while at breakpoint.
1094 Dart_SetMessageNotifyCallback(DbgMsgQueueList::NotifyIsolate); 1094 Dart_SetMessageNotifyCallback(DbgMsgQueueList::NotifyIsolate);
1095 1095
1096 while (true) { 1096 while (true) {
1097 // Handle all available vm service messages, up to a resume 1097 // Handle all available vm service messages, up to a resume
1098 // request. 1098 // request.
1099 bool resume = false; 1099 bool resume = false;
1100
1101 // Release the message queue lock before handling service
1102 // messages. This allows notifications to come in while we are
1103 // processing long requests and avoids deadlock with the PortMap
1104 // lock in the vm.
1105 msg_queue_lock_.Exit();
1106 while (!resume && Dart_HasServiceMessages()) { 1100 while (!resume && Dart_HasServiceMessages()) {
1101 msg_queue_lock_.Exit();
1107 resume = Dart_HandleServiceMessages(); 1102 resume = Dart_HandleServiceMessages();
1103 msg_queue_lock_.Enter();
1108 } 1104 }
1109 msg_queue_lock_.Enter();
1110
1111 if (resume) { 1105 if (resume) {
1112 break; 1106 break;
1113 } 1107 }
1114 1108
1115 // Handle all available debug messages, up to a resume request. 1109 // Handle all available debug messages, up to a resume request.
1116 if (HandlePendingMessages()) { 1110 if (HandlePendingMessages()) {
1117 break; 1111 break;
1118 } 1112 }
1119 1113
1120 // Wait for more debug or vm service messages. 1114 // Wait for more debug or vm service messages.
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 } else { 1417 } else {
1424 ASSERT(kind == kShutdown); 1418 ASSERT(kind == kShutdown);
1425 RemoveIsolateMsgQueue(isolate_id); 1419 RemoveIsolateMsgQueue(isolate_id);
1426 } 1420 }
1427 } 1421 }
1428 Dart_ExitScope(); 1422 Dart_ExitScope();
1429 } 1423 }
1430 1424
1431 } // namespace bin 1425 } // namespace bin
1432 } // namespace dart 1426 } // namespace dart
OLDNEW
« 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