[Openmp-commits] [PATCH] D76780: [OpenMP] Added memory barrier to solve data race
Henry Kao via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Mar 25 11:53:42 PDT 2020
hkao13 updated this revision to Diff 252637.
hkao13 added a comment.
Moving KMP_MB above debug output.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76780/new/
https://reviews.llvm.org/D76780
Files:
openmp/runtime/src/kmp_lock.cpp
Index: openmp/runtime/src/kmp_lock.cpp
===================================================================
--- openmp/runtime/src/kmp_lock.cpp
+++ openmp/runtime/src/kmp_lock.cpp
@@ -1239,6 +1239,9 @@
KMP_MB();
// ToDo: Use __kmp_wait_sleep or similar when blocktime != inf
KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
+ // Synchronize writes to both runtime thread structures
+ // and writes in user code.
+ KMP_MB();
#ifdef DEBUG_QUEUING_LOCKS
TRACE_LOCK(gtid + 1, "acq spin");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76780.252637.patch
Type: text/x-patch
Size: 524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200325/031f9133/attachment.bin>
More information about the Openmp-commits
mailing list