| 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 #include "vm/port.h" | 6 #include "vm/port.h" |
| 7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 | 135 |
| 136 bool MessageHandler::HandleMessages(bool allow_normal_messages, | 136 bool MessageHandler::HandleMessages(bool allow_normal_messages, |
| 137 bool allow_multiple_normal_messages) { | 137 bool allow_multiple_normal_messages) { |
| 138 // TODO(turnidge): Add assert that monitor_ is held here. | 138 // TODO(turnidge): Add assert that monitor_ is held here. |
| 139 bool result = true; | 139 bool result = true; |
| 140 Message::Priority min_priority = (allow_normal_messages | 140 Message::Priority min_priority = (allow_normal_messages |
| 141 ? Message::kNormalPriority | 141 ? Message::kNormalPriority |
| 142 : Message::kOOBPriority); | 142 : Message::kOOBPriority); |
| 143 Message* message = DequeueMessage(min_priority); | 143 Message* message = DequeueMessage(min_priority); |
| 144 while (message) { | 144 while (message != NULL) { |
| 145 if (FLAG_trace_isolates) { | 145 if (FLAG_trace_isolates) { |
| 146 OS::Print("[<] Handling message:\n" | 146 OS::Print("[<] Handling message:\n" |
| 147 "\thandler: %s\n" | 147 "\thandler: %s\n" |
| 148 "\tport: %" Pd64 "\n", | 148 "\tport: %" Pd64 "\n", |
| 149 name(), message->dest_port()); | 149 name(), message->dest_port()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // Release the monitor_ temporarily while we handle the message. | 152 // Release the monitor_ temporarily while we handle the message. |
| 153 // The monitor was acquired in MessageHandler::TaskCallback(). | 153 // The monitor was acquired in MessageHandler::TaskCallback(). |
| 154 monitor_.Exit(); | 154 monitor_.Exit(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 void MessageHandler::decrement_control_ports() { | 310 void MessageHandler::decrement_control_ports() { |
| 311 MonitorLocker ml(&monitor_); | 311 MonitorLocker ml(&monitor_); |
| 312 #if defined(DEBUG) | 312 #if defined(DEBUG) |
| 313 CheckAccess(); | 313 CheckAccess(); |
| 314 #endif | 314 #endif |
| 315 control_ports_--; | 315 control_ports_--; |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace dart | 318 } // namespace dart |
| OLD | NEW |