Add time out to dump check point.

Change-Id: I2263c092c9957585ae90cf846e77dc8861f8a14b
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 3cc2a28..2dbfb3e 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -156,7 +156,11 @@
   void WaitForThreadsToRunThroughCheckpoint(size_t threads_running_checkpoint) {
     Thread* self = Thread::Current();
     ScopedThreadStateChange tsc(self, kWaitingForCheckPointsToRun);
-    barrier_.Increment(self, threads_running_checkpoint);
+    const uint32_t kWaitTimeoutMs = 10000;
+    bool timed_out = barrier_.Increment(self, threads_running_checkpoint, kWaitTimeoutMs);
+    if (timed_out) {
+      LOG(kIsDebugBuild ? FATAL : ERROR) << "Unexpected time out during dump checkpoint.";
+    }
   }
 
  private: