aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-16 00:27:35 +0000
committerOwen Anderson <resistor@mac.com>2010-09-16 00:27:35 +0000
commitcb86def1c2084f2b1c72fd04e5384d472e7cf3a0 (patch)
tree9db79c4e44d889eb630edee0196275a23e49c798 /lib/VMCore
parentf6a129a24b866635c3c51edf08749755f952b5f2 (diff)
downloadexternal_llvm-cb86def1c2084f2b1c72fd04e5384d472e7cf3a0.zip
external_llvm-cb86def1c2084f2b1c72fd04e5384d472e7cf3a0.tar.gz
external_llvm-cb86def1c2084f2b1c72fd04e5384d472e7cf3a0.tar.bz2
Fix a threaded LLVM bug due the need for operator= on reference counted AttrListImpl's. It might
be possible to implement this very carefully to allow a lock-free implementation while still avoiding illegal interleavings, but I haven't been able to figure one out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Attributes.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index a000aee..3422faf 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -195,6 +195,7 @@ AttrListPtr::AttrListPtr(const AttrListPtr &P) : AttrList(P.AttrList) {
}
const AttrListPtr &AttrListPtr::operator=(const AttrListPtr &RHS) {
+ sys::SmartScopedLock<true> Lock(*ALMutex);
if (AttrList == RHS.AttrList) return *this;
if (AttrList) AttrList->DropRef();
AttrList = RHS.AttrList;