| 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 14 matching lines...) Expand all Loading... |
| 25 private: | 25 private: |
| 26 MessageHandler* handler_; | 26 MessageHandler* handler_; |
| 27 | 27 |
| 28 DISALLOW_COPY_AND_ASSIGN(MessageHandlerTask); | 28 DISALLOW_COPY_AND_ASSIGN(MessageHandlerTask); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 | 31 |
| 32 MessageHandler::MessageHandler() | 32 MessageHandler::MessageHandler() |
| 33 : queue_(new MessageQueue()), | 33 : queue_(new MessageQueue()), |
| 34 oob_queue_(new MessageQueue()), | 34 oob_queue_(new MessageQueue()), |
| 35 control_ports_(0), |
| 35 live_ports_(0), | 36 live_ports_(0), |
| 36 pool_(NULL), | 37 pool_(NULL), |
| 37 task_(NULL), | 38 task_(NULL), |
| 38 start_callback_(NULL), | 39 start_callback_(NULL), |
| 39 end_callback_(NULL), | 40 end_callback_(NULL), |
| 40 callback_data_(0) { | 41 callback_data_(0) { |
| 41 ASSERT(queue_ != NULL); | 42 ASSERT(queue_ != NULL); |
| 42 ASSERT(oob_queue_ != NULL); | 43 ASSERT(oob_queue_ != NULL); |
| 43 } | 44 } |
| 44 | 45 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 263 |
| 263 | 264 |
| 264 void MessageHandler::decrement_live_ports() { | 265 void MessageHandler::decrement_live_ports() { |
| 265 MonitorLocker ml(&monitor_); | 266 MonitorLocker ml(&monitor_); |
| 266 #if defined(DEBUG) | 267 #if defined(DEBUG) |
| 267 CheckAccess(); | 268 CheckAccess(); |
| 268 #endif | 269 #endif |
| 269 live_ports_--; | 270 live_ports_--; |
| 270 } | 271 } |
| 271 | 272 |
| 273 |
| 274 void MessageHandler::increment_control_ports() { |
| 275 MonitorLocker ml(&monitor_); |
| 276 #if defined(DEBUG) |
| 277 CheckAccess(); |
| 278 #endif |
| 279 control_ports_++; |
| 280 } |
| 281 |
| 282 |
| 283 void MessageHandler::decrement_control_ports() { |
| 284 MonitorLocker ml(&monitor_); |
| 285 #if defined(DEBUG) |
| 286 CheckAccess(); |
| 287 #endif |
| 288 control_ports_--; |
| 289 } |
| 290 |
| 272 } // namespace dart | 291 } // namespace dart |
| OLD | NEW |