1 /* { dg-do run { target *-*-linux* *-*-gnu* *-*-freebsd* } } */
2 /* { dg-timeout 10 } */
4 /* Test that omp_fulfill_event works when called from an external
13 int event_pending
= 0;
14 omp_event_handle_t detach_event
;
17 fulfill_thread (void *)
19 while (!__atomic_load_n (&finished
, __ATOMIC_RELAXED
))
21 if (__atomic_load_n (&event_pending
, __ATOMIC_ACQUIRE
))
23 omp_fulfill_event (detach_event
);
24 __atomic_store_n (&event_pending
, 0, __ATOMIC_RELEASE
);
38 pthread_create (&thr
, NULL
, fulfill_thread
, 0);
43 omp_event_handle_t ev
;
45 #pragma omp task depend (out: dep) detach (ev)
48 __atomic_store_n (&event_pending
, 1, __ATOMIC_RELEASE
);
51 #pragma omp task depend (in: dep)
53 __atomic_store_n (&finished
, 1, __ATOMIC_RELAXED
);
57 pthread_join (thr
, 0);