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

Side by Side Diff: runtime/vm/message_handler.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, 1 month 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 | « runtime/vm/message_handler.h ('k') | runtime/vm/message_handler_test.cc » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/message_handler.h" 5 #include "vm/message_handler.h"
6 6
7 #include "vm/dart.h" 7 #include "vm/dart.h"
8 #include "vm/lockers.h" 8 #include "vm/lockers.h"
9 #include "vm/port.h" 9 #include "vm/port.h"
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 bool MessageHandler::HandleOOBMessages() { 198 bool MessageHandler::HandleOOBMessages() {
199 MonitorLocker ml(&monitor_); 199 MonitorLocker ml(&monitor_);
200 #if defined(DEBUG) 200 #if defined(DEBUG)
201 CheckAccess(); 201 CheckAccess();
202 #endif 202 #endif
203 return HandleMessages(false, false); 203 return HandleMessages(false, false);
204 } 204 }
205 205
206 206
207 bool MessageHandler::HasOOBMessages() {
208 MonitorLocker ml(&monitor_);
209 return !oob_queue_->IsEmpty();
210 }
211
212
207 void MessageHandler::TaskCallback() { 213 void MessageHandler::TaskCallback() {
208 ASSERT(Isolate::Current() == NULL); 214 ASSERT(Isolate::Current() == NULL);
209 bool ok = true; 215 bool ok = true;
210 bool run_end_callback = false; 216 bool run_end_callback = false;
211 { 217 {
212 MonitorLocker ml(&monitor_); 218 MonitorLocker ml(&monitor_);
213 // Initialize the message handler by running its start function, 219 // Initialize the message handler by running its start function,
214 // if we have one. For an isolate, this will run the isolate's 220 // if we have one. For an isolate, this will run the isolate's
215 // main() function. 221 // main() function.
216 if (pause_on_start()) { 222 if (pause_on_start()) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 306
301 void MessageHandler::decrement_live_ports() { 307 void MessageHandler::decrement_live_ports() {
302 MonitorLocker ml(&monitor_); 308 MonitorLocker ml(&monitor_);
303 #if defined(DEBUG) 309 #if defined(DEBUG)
304 CheckAccess(); 310 CheckAccess();
305 #endif 311 #endif
306 live_ports_--; 312 live_ports_--;
307 } 313 }
308 314
309 } // namespace dart 315 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/message_handler.h ('k') | runtime/vm/message_handler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698