Chromium Code Reviews| Index: runtime/vm/message_queue_test.cc |
| =================================================================== |
| --- runtime/vm/message_queue_test.cc (revision 534) |
| +++ runtime/vm/message_queue_test.cc (working copy) |
| @@ -63,18 +63,19 @@ |
| // Create a message queue and share it. |
| MessageQueue* queue = new MessageQueue(); |
| + MessageQueueTestPeer peer(queue); |
| shared_queue = queue; |
| - // Tell the other thread to fill the queue a bit. |
| + // Tell the other thread that the shared queue is ready. |
| { |
| MonitorLocker ml(sync); |
| ml.Notify(); |
| } |
|
siva
2011/10/18 22:19:59
The update to shared_queue could be under a lock:
|
| // Wait for the other thread to fill the queue a bit. |
| - { |
| + while (!peer.HasMessage()) { |
| MonitorLocker ml(sync); |
| - ml.Wait(0); |
| + ml.Wait(5); |
| } |
|
siva
2011/10/18 22:19:59
The check for peer.HasMessage() could be under a l
|
| for (int i = 0; i < 3; i++) { |
| @@ -106,9 +107,9 @@ |
| EXPECT(thread != NULL); |
| // Wait for the shared queue to be created. |
| - { |
| + while (shared_queue == NULL) { |
| MonitorLocker ml(sync); |
| - ml.Wait(0); |
| + ml.Wait(5); |
| } |
|
siva
2011/10/18 22:19:59
The check for shared queue could be under a lock:
|
| ASSERT(shared_queue != NULL); |