Index: vm/message_queue.cc |
=================================================================== |
--- vm/message_queue.cc (revision 621) |
+++ vm/message_queue.cc (working copy) |
@@ -40,13 +40,9 @@ |
PortMessage* MessageQueue::Dequeue(int64_t millis) { |
MonitorLocker ml(&monitor_); |
PortMessage* result = head_; |
- // Wait may wake up prematurely, so we need to loop until result != NULL |
- while (result == NULL) { |
+ if (result == NULL) { |
ml.Wait(millis); |
result = head_; |
- // If there's a time-out the caller must check for NULL anyway. |
- if (0 < millis) |
- break; |
} |
if (result != NULL) { |
head_ = result->next_; |