aboutsummaryrefslogtreecommitdiffstats
path: root/barrierwait.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--barrierwait.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/barrierwait.c b/barrierwait.c
new file mode 100644
index 0000000..a310a27
--- /dev/null
+++ b/barrierwait.c
@@ -0,0 +1,17 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+void
+barrierwait(pthread_barrier_t *barrier)
+{
+#ifndef SINGLE_THREADED
+ int r = pthread_barrier_wait(barrier);
+ if (r && r != PTHREAD_BARRIER_SERIAL_THREAD) {
+ errno = r;
+ eprintf("pthread_barrier_wait:");
+ }
+#else
+ (void) barrier;
+#endif
+}