Index: runtime/src/kmp_barrier.cpp =================================================================== --- runtime/src/kmp_barrier.cpp +++ runtime/src/kmp_barrier.cpp @@ -1318,6 +1318,13 @@ USE_ITT_BUILD_ARG(itt_sync_obj)); __kmp_task_team_setup(this_thr, team, 0); +#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 if (__itt_sync_create_ptr || KMP_ITT_DEBUG) __kmp_itt_barrier_finished(gtid, itt_sync_obj); Index: runtime/src/kmp_runtime.cpp =================================================================== --- runtime/src/kmp_runtime.cpp +++ runtime/src/kmp_runtime.cpp @@ -1372,6 +1372,9 @@ 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 );