[Openmp-commits] [PATCH] D41831: Minor code cleanup
Joachim Protze via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jan 9 05:38:03 PST 2018
protze.joachim added inline comments.
================
Comment at: runtime/src/kmp_tasking.cpp:990
+ task->td_dephash = NULL;
+ }
}
----------------
Moving above `task=NULL` here makes the data race visible. My suggestion:
```
kmp_taskdata_t *task = NULL;
<atomic_swap>(task, thread->th.th_current_task);
if (task && task->td_dephash) {
...
```
Whatever "atomic swap" function would be applicable.
Repository:
rL LLVM
https://reviews.llvm.org/D41831
More information about the Openmp-commits
mailing list