Index: mojo/examples/sample_app/sample_app.cc |
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc |
index 820bdd4d95fbdca8fe666eb538ad1e16bd1e506c..f4a729971bc4736e18dbb6b3b4a71e6e79313879 100644 |
--- a/mojo/examples/sample_app/sample_app.cc |
+++ b/mojo/examples/sample_app/sample_app.cc |
@@ -4,8 +4,8 @@ |
#include <stdio.h> |
-#include "base/basictypes.h" |
#include "mojo/public/system/core.h" |
+#include "mojo/public/system/macros.h" |
#include "mojo/system/core_impl.h" |
#if defined(OS_WIN) |
@@ -52,18 +52,21 @@ class SampleMessageWaiter { |
} |
void WaitAndRead() { |
- MojoResult result = mojo::Wait(pipe_, MOJO_WAIT_FLAG_READABLE, 100); |
- if (result < MOJO_RESULT_OK) { |
- // Failure... |
+ for (int i = 0; i < 100;) { |
+ MojoResult result = mojo::Wait(pipe_, MOJO_WAIT_FLAG_READABLE, 100); |
+ if (result < MOJO_RESULT_OK) { |
+ // Failure... |
+ continue; |
+ } |
+ ++i; |
+ Read(); |
} |
- |
- Read(); |
} |
private: |
- |
mojo::Handle pipe_; |
- DISALLOW_COPY_AND_ASSIGN(SampleMessageWaiter); |
+ |
+ MOJO_DISALLOW_COPY_AND_ASSIGN(SampleMessageWaiter); |
}; |
extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( |