blob: 5d37a64758531861c81b975a7eb4abcea0f3d04b [file] [log] [blame]
/* TSAN-invisible barriers. Link with -ldl. */
#include <pthread.h>
#include <dlfcn.h>
static __typeof(pthread_barrier_wait) *barrier_wait;
static
void barrier_init (pthread_barrier_t *barrier, unsigned count)
{
void *h = dlopen ("libpthread.so.0", RTLD_LAZY);
barrier_wait = (__typeof (pthread_barrier_wait) *)
dlsym (h, "pthread_barrier_wait");
pthread_barrier_init (barrier, NULL, count);
}