OSDN Git Service

Make Barrier robust against spurious wakeups
authorHans Boehm <hboehm@google.com>
Wed, 3 Dec 2014 02:31:31 +0000 (18:31 -0800)
committerHans Boehm <hboehm@google.com>
Thu, 4 Dec 2014 18:20:12 +0000 (10:20 -0800)
commit5567c11b9157eec110c0631aa2bff5836631e868
tree6385002190e857aa2cedd813f461bb6b038fe4c5
parent27478e627e08ab42c43d5d934da9ea336ccaf628
Make Barrier robust against spurious wakeups

Fix Barrier implementation so that Wait cannot return prematurely
due to a spurious condition variable wakeup or interrupted futex call.

Document the resulting semantics of barrier.h, which are a bit surprising,
but appear to be exactly what current clients need.

Fix the test so that it actually passes with the fixed barrier.h,
and no longer tests for properties that can't be correctly satisfied.

Improve comment for InitTimeSpec, which we almost used.

Bug:18509123

Change-Id: I0b25f33bcd22322ba04e3951cd484843788c2bf5
runtime/barrier.cc
runtime/barrier.h
runtime/barrier_test.cc
runtime/utils.h