summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_barrier.cpp7
-rw-r--r--openmp/runtime/src/kmp_runtime.cpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_barrier.cpp b/openmp/runtime/src/kmp_barrier.cpp
index d08873fdcf3..a9a46f14372 100644
--- a/openmp/runtime/src/kmp_barrier.cpp
+++ b/openmp/runtime/src/kmp_barrier.cpp
@@ -1212,6 +1212,13 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size,
team->t.t_bar[bt].b_team_arrived += 1;
#endif
+#if OMP_40_ENABLED
+ // Reset cancellation flag for worksharing constructs
+ if(team->t.t_cancel_request == cancel_loop ||
+ team->t.t_cancel_request == cancel_sections ) {
+ team->t.t_cancel_request = cancel_noreq;
+ }
+#endif
#if USE_ITT_BUILD
/* TODO: In case of split reduction barrier, master thread may send acquired event early,
before the final summation into the shared variable is done (final summation can be a
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index e92c9b1308c..5d5f5de13de 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -1372,6 +1372,9 @@ __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid)
KMP_MB();
}
+#if OMP_40_ENABLED
+ KMP_CHECK_UPDATE(serial_team->t.t_cancel_request, cancel_noreq);
+#endif
if ( __kmp_env_consistency_check )
__kmp_push_parallel( global_tid, NULL );
OpenPOWER on IntegriCloud