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/object.h" | 9 #include "vm/object.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 | 177 |
178 MessageHandler::MessageStatus MessageHandler::HandleMessages( | 178 MessageHandler::MessageStatus MessageHandler::HandleMessages( |
179 bool allow_normal_messages, | 179 bool allow_normal_messages, |
180 bool allow_multiple_normal_messages) { | 180 bool allow_multiple_normal_messages) { |
181 // TODO(turnidge): Add assert that monitor_ is held here. | 181 // TODO(turnidge): Add assert that monitor_ is held here. |
182 | 182 |
183 // If isolate() returns NULL StartIsolateScope does nothing. | 183 // If isolate() returns NULL StartIsolateScope does nothing. |
184 StartIsolateScope start_isolate(isolate()); | 184 StartIsolateScope start_isolate(isolate()); |
185 | 185 |
| 186 // ThreadInterrupter may have gone to sleep while waiting for |
| 187 // an isolate to start handling messages. |
| 188 ThreadInterrupter::WakeUp(); |
| 189 |
186 MessageStatus max_status = kOK; | 190 MessageStatus max_status = kOK; |
187 Message::Priority min_priority = ((allow_normal_messages && !paused()) | 191 Message::Priority min_priority = ((allow_normal_messages && !paused()) |
188 ? Message::kNormalPriority | 192 ? Message::kNormalPriority |
189 : Message::kOOBPriority); | 193 : Message::kOOBPriority); |
190 Message* message = DequeueMessage(min_priority); | 194 Message* message = DequeueMessage(min_priority); |
191 while (message != NULL) { | 195 while (message != NULL) { |
192 intptr_t message_len = message->len(); | 196 intptr_t message_len = message->len(); |
193 if (FLAG_trace_isolates) { | 197 if (FLAG_trace_isolates) { |
194 OS::Print("[<] Handling message:\n" | 198 OS::Print("[<] Handling message:\n" |
195 "\tlen: %" Pd "\n" | 199 "\tlen: %" Pd "\n" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 475 |
472 | 476 |
473 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) { | 477 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) { |
474 ASSERT(acquired_queues != NULL); | 478 ASSERT(acquired_queues != NULL); |
475 // No double dipping. | 479 // No double dipping. |
476 ASSERT(acquired_queues->handler_ == NULL); | 480 ASSERT(acquired_queues->handler_ == NULL); |
477 acquired_queues->Reset(this); | 481 acquired_queues->Reset(this); |
478 } | 482 } |
479 | 483 |
480 } // namespace dart | 484 } // namespace dart |
OLD | NEW |