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.