Summary: Handle wake-ups correctly in futexWaitUntilImpl.
Test Plan:
-- ran all folly unit tests
-- ran TimeoutWorkQueue test under tao/queues
Reviewed By: ngbronson@fb.com, meyering@fb.com
FB internal diff:
D1406845
Tasks:
4494871
futexLock.lock();
// Simulate spurious wake-ups, timeouts each time with
- // a 10% probability
- if (DeterministicSchedule::getRandNumber(100) < 10) {
+ // a 10% probability if we haven't been woken up already
+ if (!rv && DeterministicSchedule::getRandNumber(100) < 10) {
+ assert(futexQueues.count(futex) != 0 &&
+ &futexQueues[futex] == &queue);
queue.erase(ours);
if (queue.empty()) {
futexQueues.erase(futex);