14 ABTD_xstream_barrier bar;
15 } ABTI_xstream_barrier;
17 #ifdef HAVE_PTHREAD_BARRIER_INIT 18 static inline ABTI_xstream_barrier *
21 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK 22 ABTI_xstream_barrier *p_barrier;
26 p_barrier = (ABTI_xstream_barrier *)barrier;
30 return (ABTI_xstream_barrier *)barrier;
35 ABTI_xstream_barrier_get_handle(ABTI_xstream_barrier *p_barrier)
37 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK 39 if (p_barrier == NULL) {
68 #ifdef HAVE_PTHREAD_BARRIER_INIT 70 ABTI_xstream_barrier *p_newbarrier;
73 (ABTI_xstream_barrier *)
ABTU_malloc(
sizeof(ABTI_xstream_barrier));
75 p_newbarrier->num_waiters = num_waiters;
76 abt_errno = ABTD_xstream_barrier_init(num_waiters, &p_newbarrier->bar);
77 ABTI_CHECK_ERROR(abt_errno);
80 *newbarrier = ABTI_xstream_barrier_get_handle(p_newbarrier);
107 #ifdef HAVE_PTHREAD_BARRIER_INIT 110 ABTI_xstream_barrier *p_barrier = ABTI_xstream_barrier_get_ptr(h_barrier);
111 ABTI_CHECK_NULL_XSTREAM_BARRIER_PTR(p_barrier);
113 abt_errno = ABTD_xstream_barrier_destroy(&p_barrier->bar);
114 ABTI_CHECK_ERROR(abt_errno);
145 #ifdef HAVE_PTHREAD_BARRIER_INIT 147 ABTI_xstream_barrier *p_barrier = ABTI_xstream_barrier_get_ptr(barrier);
148 ABTI_CHECK_NULL_XSTREAM_BARRIER_PTR(p_barrier);
150 if (p_barrier->num_waiters > 1) {
151 ABTD_xstream_barrier_wait(&p_barrier->bar);
int ABT_xstream_barrier_create(uint32_t num_waiters, ABT_xstream_barrier *newbarrier)
Create a new ES barrier.
static void * ABTU_malloc(size_t size)
int ABT_xstream_barrier_wait(ABT_xstream_barrier barrier)
Wait on the barrier.
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
struct ABT_xstream_barrier_opaque * ABT_xstream_barrier
#define ABT_ERR_FEATURE_NA
int ABT_xstream_barrier_free(ABT_xstream_barrier *barrier)
Free the ES barrier.
#define ABT_XSTREAM_BARRIER_NULL
static void ABTU_free(void *ptr)