This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix handling of condition variable destruction
ClosedPublic

Authored by dvyukov on Jun 24 2015, 8:20 AM.

Details

Reviewers
EricWF
Summary

POSIX states that "It shall be safe to destroy an initialized condition variable upon which no threads are currently blocked", and later clarifies "A condition variable can be destroyed immediately after all the threads that are blocked on it are awakened) (in examples section). Tsan reported such destruction as a data race.
Fixes https://llvm.org/bugs/show_bug.cgi?id=23616

Diff Detail

Event Timeline

dvyukov updated this revision to Diff 28356.Jun 24 2015, 8:20 AM
dvyukov retitled this revision from to tsan: fix handling of condition variable destruction.
dvyukov updated this object.
dvyukov edited the test plan for this revision. (Show Details)
dvyukov added a reviewer: EricWF.
dvyukov added a subscriber: Unknown Object (MLST).
EricWF accepted this revision.Jun 30 2015, 10:02 AM
EricWF edited edge metadata.

The test case and fix look right to me. Couldn't you just use the exit code of the test directly instead of using FileCheck?

This revision is now accepted and ready to land.Jun 30 2015, 10:02 AM

The exit code is also checked. lit test driver ensure that all commands exit with 0 status (we run tests that contain races with 'not' bash command). So that's kind of two levels of protection :)

dvyukov closed this revision.Jun 30 2015, 10:23 AM

Submitted in 241082.