6 #ifndef ABTD_STREAM_H_INCLUDED
7 #define ABTD_STREAM_H_INCLUDED
9 #ifdef HAVE_PTHREAD_BARRIER_INIT
11 ABTD_xstream_barrier_init(uint32_t num_waiters, ABTD_xstream_barrier *p_barrier)
13 int ret = pthread_barrier_init(p_barrier, NULL, num_waiters);
17 static inline void ABTD_xstream_barrier_destroy(ABTD_xstream_barrier *p_barrier)
19 int ret = pthread_barrier_destroy(p_barrier);
20 ABTI_ASSERT(ret == 0);
23 static inline void ABTD_xstream_barrier_wait(ABTD_xstream_barrier *p_barrier)
25 int ret = pthread_barrier_wait(p_barrier);
26 ABTI_ASSERT(ret == PTHREAD_BARRIER_SERIAL_THREAD || ret == 0);