| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); |
| 155 Message::Priority saved_priority = message->priority(); | 155 Message::Priority saved_priority = message->priority(); |
| 156 result = HandleMessage(message); | 156 result = HandleMessage(message); |
| 157 monitor_.Enter(); | 157 monitor_.Enter(); |
| 158 if (FLAG_trace_isolates) { |
| 159 OS::Print("[.] Message handled:\n" |
| 160 "\thandler: %s\n" |
| 161 "\tport: %" Pd64 "\n", |
| 162 name(), message->dest_port()); |
| 163 } |
| 158 if (!result) { | 164 if (!result) { |
| 159 // If we hit an error, we're done processing messages. | 165 // If we hit an error, we're done processing messages. |
| 160 break; | 166 break; |
| 161 } | 167 } |
| 162 if (!allow_multiple_normal_messages && | 168 if (!allow_multiple_normal_messages && |
| 163 saved_priority == Message::kNormalPriority) { | 169 saved_priority == Message::kNormalPriority) { |
| 164 // Some callers want to process only one normal message and then quit. | 170 // Some callers want to process only one normal message and then quit. |
| 165 break; | 171 break; |
| 166 } | 172 } |
| 167 message = DequeueMessage(min_priority); | 173 message = DequeueMessage(min_priority); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 305 |
| 300 void MessageHandler::decrement_control_ports() { | 306 void MessageHandler::decrement_control_ports() { |
| 301 MonitorLocker ml(&monitor_); | 307 MonitorLocker ml(&monitor_); |
| 302 #if defined(DEBUG) | 308 #if defined(DEBUG) |
| 303 CheckAccess(); | 309 CheckAccess(); |
| 304 #endif | 310 #endif |
| 305 control_ports_--; | 311 control_ports_--; |
| 306 } | 312 } |
| 307 | 313 |
| 308 } // namespace dart | 314 } // namespace dart |
| OLD | NEW |