Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc =================================================================== --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -209,10 +209,10 @@ bool ThreadSuspender::SuspendAllThreads() { ThreadLister thread_lister(pid_); - bool retry; + bool retry = true; InternalMmapVector threads; threads.reserve(128); - do { + for (int i = 0; i < 30 && retry; ++i) { retry = false; switch (thread_lister.ListThreads(&threads)) { case ThreadLister::Error: @@ -227,7 +227,7 @@ for (tid_t tid : threads) if (SuspendThread(tid)) retry = true; - } while (retry); + }; return suspended_threads_list_.ThreadCount(); }