summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_wait_release.h
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src/kmp_wait_release.h')
-rw-r--r--openmp/runtime/src/kmp_wait_release.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/openmp/runtime/src/kmp_wait_release.h b/openmp/runtime/src/kmp_wait_release.h
index 2f7048cddd6..31beccd90a6 100644
--- a/openmp/runtime/src/kmp_wait_release.h
+++ b/openmp/runtime/src/kmp_wait_release.h
@@ -178,12 +178,14 @@ static inline void __kmp_wait_template(kmp_info_t *this_thr, C *flag, int final_
if (__kmp_tasking_mode != tskm_immediate_exec) {
task_team = this_thr->th.th_task_team;
if (task_team != NULL) {
- if (!TCR_SYNC_4(task_team->tt.tt_active)) {
+ if (TCR_SYNC_4(task_team->tt.tt_active)) {
+ if (KMP_TASKING_ENABLED(task_team))
+ flag->execute_tasks(this_thr, th_gtid, final_spin, &tasks_completed
+ USE_ITT_BUILD_ARG(itt_sync_obj), 0);
+ }
+ else {
KMP_DEBUG_ASSERT(!KMP_MASTER_TID(this_thr->th.th_info.ds.ds_tid));
- __kmp_unref_task_team(task_team, this_thr);
- } else if (KMP_TASKING_ENABLED(task_team)) {
- flag->execute_tasks(this_thr, th_gtid, final_spin, &tasks_completed
- USE_ITT_BUILD_ARG(itt_sync_obj), 0);
+ this_thr->th.th_task_team = NULL;
}
} // if
} // if
OpenPOWER on IntegriCloud