| Index: runtime/vm/message.cc
|
| diff --git a/runtime/vm/message.cc b/runtime/vm/message.cc
|
| index 73f5da3c76b62652c2ee2c1b52285831e59524c6..7df75a3c18c8b3f9c1f50c016c75b4edcf19fe7a 100644
|
| --- a/runtime/vm/message.cc
|
| +++ b/runtime/vm/message.cc
|
| @@ -29,9 +29,15 @@ void MessageQueue::Enqueue(Message* msg) {
|
| tail_ = msg;
|
| } else {
|
| ASSERT(tail_ != NULL);
|
| - // Append at the tail.
|
| - tail_->next_ = msg;
|
| - tail_ = msg;
|
| + if (msg->priority() == Message::kFirstPriority) {
|
| + // Set as head element in the queue.
|
| + msg->next_ = head_;
|
| + head_ = msg;
|
| + } else {
|
| + // Append at the tail.
|
| + tail_->next_ = msg;
|
| + tail_ = msg;
|
| + }
|
| }
|
| }
|
|
|
|
|