The tsan_test_util_posix.cc implementation of mutexes call pthread APIs directly, which on OS X don't end up calling the intercepted versions and we miss the synchronization. This patch changes the unit tests to directly call the intercepted versions. This fixes several test failures on OS X.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I wonder what's the difference between this test and user code? Normal user code does not call interceptors directly, but still we [hopefully] intercept these calls. Can we make this test behave more like user code instead? There is always value in tests doing exactly the same thing as real system.
Comment Actions
In unit tests (not lit tests) we want to call internal functions (not exported by the dylib), so we build a static library instead of the dylib. In a static library, interceptors don't work on OS X. User code always uses the dylib -- that's the difference.