| 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 #ifndef VM_MESSAGE_H_ | 5 #ifndef VM_MESSAGE_H_ |
| 6 #define VM_MESSAGE_H_ | 6 #define VM_MESSAGE_H_ |
| 7 | 7 |
| 8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
| 9 | 9 |
| 10 // Duplicated from dart_api.h to avoid including the whole header. | 10 // Duplicated from dart_api.h to avoid including the whole header. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 public: | 69 public: |
| 70 MessageQueue(); | 70 MessageQueue(); |
| 71 ~MessageQueue(); | 71 ~MessageQueue(); |
| 72 | 72 |
| 73 void Enqueue(Message* msg); | 73 void Enqueue(Message* msg); |
| 74 | 74 |
| 75 // Gets the next message from the message queue or NULL if no | 75 // Gets the next message from the message queue or NULL if no |
| 76 // message is available. This function will not block. | 76 // message is available. This function will not block. |
| 77 Message* Dequeue(); | 77 Message* Dequeue(); |
| 78 | 78 |
| 79 void Flush(Dart_Port port); | 79 // Clear all messages from the message queue. |
| 80 void FlushAll(); | 80 void Clear(); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 friend class MessageQueueTestPeer; | 83 friend class MessageQueueTestPeer; |
| 84 | 84 |
| 85 Message* head_; | 85 Message* head_; |
| 86 Message* tail_; | 86 Message* tail_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(MessageQueue); | 88 DISALLOW_COPY_AND_ASSIGN(MessageQueue); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace dart | 91 } // namespace dart |
| 92 | 92 |
| 93 #endif // VM_MESSAGE_H_ | 93 #endif // VM_MESSAGE_H_ |
| OLD | NEW |