OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |