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

Side by Side Diff: runtime/vm/message_handler.cc

Issue 1142283003: Ensure that the ThreadInterrupter is awake after debugging (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | 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 #include "vm/thread_interrupter.h"
10 11
11 namespace dart { 12 namespace dart {
12 13
13 DECLARE_FLAG(bool, trace_isolates); 14 DECLARE_FLAG(bool, trace_isolates);
14 DECLARE_FLAG(bool, trace_service_pause_events); 15 DECLARE_FLAG(bool, trace_service_pause_events);
15 16
16 class MessageHandlerTask : public ThreadPool::Task { 17 class MessageHandlerTask : public ThreadPool::Task {
17 public: 18 public:
18 explicit MessageHandlerTask(MessageHandler* handler) 19 explicit MessageHandlerTask(MessageHandler* handler)
19 : handler_(handler) { 20 : handler_(handler) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 139 }
139 return message; 140 return message;
140 } 141 }
141 142
142 143
143 bool MessageHandler::HandleMessages(bool allow_normal_messages, 144 bool MessageHandler::HandleMessages(bool allow_normal_messages,
144 bool allow_multiple_normal_messages) { 145 bool allow_multiple_normal_messages) {
145 // If isolate() returns NULL StartIsolateScope does nothing. 146 // If isolate() returns NULL StartIsolateScope does nothing.
146 StartIsolateScope start_isolate(isolate()); 147 StartIsolateScope start_isolate(isolate());
147 148
149 // ThreadInterrupter may have gone to sleep waiting while waiting for
150 // an isolate to start handling messages.
151 ThreadInterrupter::WakeUp();
152
148 // TODO(turnidge): Add assert that monitor_ is held here. 153 // TODO(turnidge): Add assert that monitor_ is held here.
149 bool result = true; 154 bool result = true;
150 Message::Priority min_priority = (allow_normal_messages && !paused()) ? 155 Message::Priority min_priority = (allow_normal_messages && !paused()) ?
151 Message::kNormalPriority : Message::kOOBPriority; 156 Message::kNormalPriority : Message::kOOBPriority;
152 Message* message = DequeueMessage(min_priority); 157 Message* message = DequeueMessage(min_priority);
153 while (message != NULL) { 158 while (message != NULL) {
154 intptr_t message_len = message->len(); 159 intptr_t message_len = message->len();
155 if (FLAG_trace_isolates) { 160 if (FLAG_trace_isolates) {
156 OS::Print("[<] Handling message:\n" 161 OS::Print("[<] Handling message:\n"
157 "\tlen: %" Pd "\n" 162 "\tlen: %" Pd "\n"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 371
367 372
368 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) { 373 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) {
369 ASSERT(acquired_queues != NULL); 374 ASSERT(acquired_queues != NULL);
370 // No double dipping. 375 // No double dipping.
371 ASSERT(acquired_queues->handler_ == NULL); 376 ASSERT(acquired_queues->handler_ == NULL);
372 acquired_queues->Reset(this); 377 acquired_queues->Reset(this);
373 } 378 }
374 379
375 } // namespace dart 380 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698