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

Side by Side Diff: runtime/bin/dbg_message.cc

Issue 1279733003: Clean VM thread shutdown: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 4 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/bin/dartutils.cc ('k') | runtime/bin/gen_snapshot.cc » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "bin/dbg_connection.h" 5 #include "bin/dbg_connection.h"
6 #include "bin/dbg_message.h" 6 #include "bin/dbg_message.h"
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "bin/lockers.h" 8 #include "bin/lockers.h"
9 #include "bin/thread.h" 9 #include "bin/thread.h"
10 #include "bin/utils.h" 10 #include "bin/utils.h"
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 ASSERT(msg_queue != NULL); 1395 ASSERT(msg_queue != NULL);
1396 msg_queue->SendQueuedMsgs(); 1396 msg_queue->SendQueuedMsgs();
1397 msg_queue->SendExceptionEvent(exception, stack_trace); 1397 msg_queue->SendExceptionEvent(exception, stack_trace);
1398 msg_queue->MessageLoop(); 1398 msg_queue->MessageLoop();
1399 Dart_ExitScope(); 1399 Dart_ExitScope();
1400 } 1400 }
1401 1401
1402 1402
1403 void DbgMsgQueueList::IsolateEventHandler(Dart_IsolateId isolate_id, 1403 void DbgMsgQueueList::IsolateEventHandler(Dart_IsolateId isolate_id,
1404 Dart_IsolateEvent kind) { 1404 Dart_IsolateEvent kind) {
1405 DebuggerConnectionHandler::WaitForConnection();
1406 Dart_EnterScope();
1407 if (kind == kCreated) { 1405 if (kind == kCreated) {
1406 DebuggerConnectionHandler::WaitForConnection();
1407 Dart_EnterScope();
1408 DbgMsgQueue* msg_queue = AddIsolateMsgQueue(isolate_id); 1408 DbgMsgQueue* msg_queue = AddIsolateMsgQueue(isolate_id);
1409 msg_queue->SendIsolateEvent(isolate_id, kind); 1409 msg_queue->SendIsolateEvent(isolate_id, kind);
1410 Dart_ExitScope();
1410 } else { 1411 } else {
1411 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); 1412 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id);
1412 if (msg_queue != NULL) { 1413 if (msg_queue != NULL) {
1414 DebuggerConnectionHandler::WaitForConnection();
1415 Dart_EnterScope();
1413 msg_queue->SendQueuedMsgs(); 1416 msg_queue->SendQueuedMsgs();
1414 msg_queue->SendIsolateEvent(isolate_id, kind); 1417 msg_queue->SendIsolateEvent(isolate_id, kind);
1415 if (kind == kInterrupted) { 1418 if (kind == kInterrupted) {
1416 msg_queue->MessageLoop(); 1419 msg_queue->MessageLoop();
1417 } else { 1420 } else {
1418 ASSERT(kind == kShutdown); 1421 ASSERT(kind == kShutdown);
1419 RemoveIsolateMsgQueue(isolate_id); 1422 RemoveIsolateMsgQueue(isolate_id);
1420 } 1423 }
1424 Dart_ExitScope();
1421 } 1425 }
1426 // If there is no receive message queue, do not wait for a connection, and
1427 // ignore the message.
1422 } 1428 }
1423 Dart_ExitScope();
1424 } 1429 }
1425 1430
1426 } // namespace bin 1431 } // namespace bin
1427 } // namespace dart 1432 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698