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/os.h" | 9 #include "vm/os.h" |
10 #include "vm/port.h" | 10 #include "vm/port.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 if (FLAG_trace_isolates) { | 313 if (FLAG_trace_isolates) { |
314 OS::Print("[-] Stopping message handler (%s):\n" | 314 OS::Print("[-] Stopping message handler (%s):\n" |
315 "\thandler: %s\n", | 315 "\thandler: %s\n", |
316 (ok ? "no live ports" : "error"), | 316 (ok ? "no live ports" : "error"), |
317 name()); | 317 name()); |
318 } | 318 } |
319 pool_ = NULL; | 319 pool_ = NULL; |
320 run_end_callback = true; | 320 run_end_callback = true; |
321 } | 321 } |
322 | 322 |
323 // Clear the task_ last. We don't want any other tasks to start up | 323 // Clear the task_ last. This allows other tasks to potentially start |
324 // until we are done with all messages and pause notifications. | 324 // for this message handler. |
325 ASSERT(oob_queue_->IsEmpty()); | 325 ASSERT(oob_queue_->IsEmpty()); |
326 ASSERT(!ok || queue_->IsEmpty()); | |
327 task_ = NULL; | 326 task_ = NULL; |
328 } | 327 } |
329 if (run_end_callback && end_callback_ != NULL) { | 328 if (run_end_callback && end_callback_ != NULL) { |
330 end_callback_(callback_data_); | 329 end_callback_(callback_data_); |
331 // The handler may have been deleted after this point. | 330 // The handler may have been deleted after this point. |
332 } | 331 } |
333 } | 332 } |
334 | 333 |
335 | 334 |
336 void MessageHandler::ClosePort(Dart_Port port) { | 335 void MessageHandler::ClosePort(Dart_Port port) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 402 |
404 | 403 |
405 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) { | 404 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) { |
406 ASSERT(acquired_queues != NULL); | 405 ASSERT(acquired_queues != NULL); |
407 // No double dipping. | 406 // No double dipping. |
408 ASSERT(acquired_queues->handler_ == NULL); | 407 ASSERT(acquired_queues->handler_ == NULL); |
409 acquired_queues->Reset(this); | 408 acquired_queues->Reset(this); |
410 } | 409 } |
411 | 410 |
412 } // namespace dart | 411 } // namespace dart |
OLD | NEW |