This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Implement an invisible barrier in the runtime to make it available on OS X
AbandonedPublic

Authored by kubamracek on Nov 6 2015, 1:29 AM.

Details

Summary

For the lit tests, we currently have a "TSan-invisible barrier" that is implemented by dlsym-ing pthread_barrier_wait. However, on OS X, pthread barriers are not available, so we need to reimplement them.

This patch proposes to provide __tsan_invisible_barrier_init and __tsan_invisible_barrier_wait in the TSan runtime, with different implementations based on the platform. This way, we don't need the dlsym trick.

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 39494.Nov 6 2015, 1:29 AM
kubamracek retitled this revision from to [tsan] Implement an invisible barrier in the runtime to make it available on OS X.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, kcc, samsonov, glider.
dvyukov edited edge metadata.Nov 6 2015, 2:33 AM

I am not very comfortable complicating runtime for tests sake. As you see the runtime has enough complexity and platform-dependent stuff. Also this implementation can have problems on some other platforms.
Will http://reviews.llvm.org/D14434 work for you?

kubamracek abandoned this revision.Nov 6 2015, 2:57 AM

http://reviews.llvm.org/D14434 looks better, closing this revision.