From d778cd68c5d093c2fb95f91608deb36fea8e8bad Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 5 Jul 2016 17:29:55 +0100 Subject: [PATCH] Expect spurious wake-up from futex(2)/FUTEX_WAIT call. Test: Run standard ART test suite. Bug: 27913630 Change-Id: I742544f7a0a7f896e47293d209a874782577e971 --- runtime/thread_list.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index 97bcb7d40..16ef0fff2 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc @@ -613,11 +613,7 @@ void ThreadList::SuspendAllInternal(Thread* self, PLOG(FATAL) << "futex wait failed for SuspendAllInternal()"; } } - } else { - cur_val = pending_threads.LoadRelaxed(); - CHECK_EQ(cur_val, 0); - break; - } + } // else re-check pending_threads in the next iteration (this may be a spurious wake-up). #else // Spin wait. This is likely to be slow, but on most architecture ART_USE_FUTEXES is set. #endif -- 2.11.0