Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / c-c++-common / tsan / tsan_barrier.h
blob5d37a64758531861c81b975a7eb4abcea0f3d04b
1 /* TSAN-invisible barriers. Link with -ldl. */
2 #include <pthread.h>
3 #include <dlfcn.h>
5 static __typeof(pthread_barrier_wait) *barrier_wait;
7 static
8 void barrier_init (pthread_barrier_t *barrier, unsigned count)
10 void *h = dlopen ("libpthread.so.0", RTLD_LAZY);
11 barrier_wait = (__typeof (pthread_barrier_wait) *)
12 dlsym (h, "pthread_barrier_wait");
13 pthread_barrier_init (barrier, NULL, count);