diff options
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 157dafa7a2c..44f34e62d82 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -37,8 +37,12 @@ ModuleList::ModuleList() : // Copy constructor //---------------------------------------------------------------------- ModuleList::ModuleList(const ModuleList& rhs) : - m_modules(rhs.m_modules) + m_modules(), + m_modules_mutex (Mutex::eMutexTypeRecursive) { + Mutex::Locker lhs_locker(m_modules_mutex); + Mutex::Locker rhs_locker(rhs.m_modules_mutex); + m_modules = rhs.m_modules; } //---------------------------------------------------------------------- @@ -49,7 +53,8 @@ ModuleList::operator= (const ModuleList& rhs) { if (this != &rhs) { - Mutex::Locker locker(m_modules_mutex); + Mutex::Locker lhs_locker(m_modules_mutex); + Mutex::Locker rhs_locker(rhs.m_modules_mutex); m_modules = rhs.m_modules; } return *this; |