summaryrefslogtreecommitdiff
path: root/libgomp/barrier.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/barrier.c')
-rw-r--r--libgomp/barrier.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libgomp/barrier.c b/libgomp/barrier.c
index dfd0bd49f50..2a9fe8f8b88 100644
--- a/libgomp/barrier.c
+++ b/libgomp/barrier.c
@@ -39,3 +39,15 @@ GOMP_barrier (void)
gomp_team_barrier_wait (&team->barrier);
}
+
+bool
+GOMP_barrier_cancel (void)
+{
+ struct gomp_thread *thr = gomp_thread ();
+ struct gomp_team *team = thr->ts.team;
+
+ /* The compiler transforms to barrier_cancel when it sees that the
+ barrier is within a construct that can cancel. Thus we should
+ never have an orphaned cancellable barrier. */
+ return gomp_team_barrier_wait_cancel (&team->barrier);
+}