summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_lock.cpp
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2017-12-08 15:07:02 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2017-12-08 15:07:02 +0000
commit86c307821c8d6fab396136b55ab8fb479238bc69 (patch)
treedffec338f1819be07ac94b351b945ac7cdb5157f /openmp/runtime/src/kmp_lock.cpp
parentdfa430f6947427394b48a8341621df4fd2f79998 (diff)
downloadbcm5719-llvm-86c307821c8d6fab396136b55ab8fb479238bc69.tar.gz
bcm5719-llvm-86c307821c8d6fab396136b55ab8fb479238bc69.zip
Add missing memory barrier for queuing locks
Otherwise I see hangs in the omp_single_copyprivate test when compiling in release mode. With the debug assertions, I get a failure `head > 0 && tail > 0`. Differential Revision: https://reviews.llvm.org/D40722 llvm-svn: 320150
Diffstat (limited to 'openmp/runtime/src/kmp_lock.cpp')
-rw-r--r--openmp/runtime/src/kmp_lock.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp
index 9c7dcaff74a..fb9edb1727a 100644
--- a/openmp/runtime/src/kmp_lock.cpp
+++ b/openmp/runtime/src/kmp_lock.cpp
@@ -1456,6 +1456,7 @@ int __kmp_release_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
}
dequeued = FALSE;
} else {
+ KMP_MB();
tail = *tail_id_p;
if (head == tail) { /* only one thread on the queue */
#ifdef DEBUG_QUEUING_LOCKS
OpenPOWER on IntegriCloud