Skip to content

Commit

Permalink
Import a fix from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Raúl Peñacoba Veigas committed May 14, 2024
1 parent 39e7ffa commit f59bfe3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openmp/runtime/src/kmp_taskdeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,12 @@ void __kmpc_omp_taskwait_deps_51(ident_t *loc_ref, kmp_int32 gtid,
__kmp_task_stealing_constraint);
}

// Wait until the last __kmp_release_deps is finished before we free the
// current stack frame holding the "node" variable; once its nrefs count
// reaches 1, we're sure nobody else can try to reference it again.
while (node.dn.nrefs > 1)
KMP_YIELD(TRUE);

#if OMPT_SUPPORT
__ompt_taskwait_dep_finish(current_task, taskwait_task_data);
#endif /* OMPT_SUPPORT */
Expand Down

0 comments on commit f59bfe3

Please sign in to comment.