[Openmp-commits] [PATCH] D33794: Fix static initializers for locks.
Jonathan Peyton via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jun 6 13:25:06 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL304828: Fix static initializers for locks. (authored by jlpeyton).
Changed prior to commit:
https://reviews.llvm.org/D33794?vs=101062&id=101607#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33794
Files:
openmp/trunk/runtime/src/kmp_lock.h
Index: openmp/trunk/runtime/src/kmp_lock.h
===================================================================
--- openmp/trunk/runtime/src/kmp_lock.h
+++ openmp/trunk/runtime/src/kmp_lock.h
@@ -122,7 +122,8 @@
// ----------------------------------------------------------------------------
struct kmp_base_tas_lock {
- volatile kmp_int32 poll; // 0 => unlocked; locked: (gtid+1) of owning thread
+ // KMP_LOCK_FREE(tas) => unlocked; locked: (gtid+1) of owning thread
+ volatile kmp_int32 poll;
kmp_int32 depth_locked; // depth locked, for nested locks only
};
@@ -140,7 +141,7 @@
// kmp_tas_lock_t xlock = KMP_TAS_LOCK_INITIALIZER( xlock );
#define KMP_TAS_LOCK_INITIALIZER(lock) \
{ \
- { 0, 0 } \
+ { KMP_LOCK_FREE(tas), 0 } \
}
extern int __kmp_acquire_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid);
@@ -178,7 +179,7 @@
// ----------------------------------------------------------------------------
struct kmp_base_futex_lock {
- volatile kmp_int32 poll; // 0 => unlocked
+ volatile kmp_int32 poll; // KMP_LOCK_FREE(futex) => unlocked
// 2*(gtid+1) of owning thread, 0 if unlocked
// locked: (gtid+1) of owning thread
kmp_int32 depth_locked; // depth locked, for nested locks only
@@ -199,7 +200,7 @@
// kmp_futex_lock_t xlock = KMP_FUTEX_LOCK_INITIALIZER( xlock );
#define KMP_FUTEX_LOCK_INITIALIZER(lock) \
{ \
- { 0, 0 } \
+ { KMP_LOCK_FREE(futex), 0 } \
}
extern int __kmp_acquire_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33794.101607.patch
Type: text/x-patch
Size: 1965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170606/d08da30a/attachment.bin>
More information about the Openmp-commits
mailing list