forked from OSchip/llvm-project
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. llvm-svn: 114046
This commit is contained in:
parent
b60e70f963
commit
8dc0b04106
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue