This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Replace pthread semaphore in signal_cond.cc with barrier_wait
ClosedPublic

Authored by kubamracek on Nov 23 2015, 6:27 AM.

Details

Summary

Pthread semaphores are not available on OS X. Let's replace sem_wait/sem_post with barrier_wait, which makes the test pass on OS X. I know that sem_wait/sem_post is intercepted by TSan, whereas barrier_wait is TSan-invisible, but the purpose of the test is not affected by this.

Also, let's properly initialize the mutex and cond variables.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 40922.Nov 23 2015, 6:27 AM
kubamracek retitled this revision from to [tsan] Replace pthread semaphore in signal_cond.cc with barrier_wait.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, kcc, glider, samsonov.
dvyukov accepted this revision.Nov 23 2015, 7:49 AM
dvyukov edited edge metadata.
This revision is now accepted and ready to land.Nov 23 2015, 7:49 AM
This revision was automatically updated to reflect the committed changes.