diff options
Diffstat (limited to 'source/Breakpoint/BreakpointLocationCollection.cpp')
| -rw-r--r-- | source/Breakpoint/BreakpointLocationCollection.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/Breakpoint/BreakpointLocationCollection.cpp b/source/Breakpoint/BreakpointLocationCollection.cpp index 27957a50d2b0..76084adbd2aa 100644 --- a/source/Breakpoint/BreakpointLocationCollection.cpp +++ b/source/Breakpoint/BreakpointLocationCollection.cpp @@ -1,9 +1,8 @@ //===-- BreakpointLocationCollection.cpp ------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -17,15 +16,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // BreakpointLocationCollection constructor -//---------------------------------------------------------------------- BreakpointLocationCollection::BreakpointLocationCollection() : m_break_loc_collection(), m_collection_mutex() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- BreakpointLocationCollection::~BreakpointLocationCollection() {} void BreakpointLocationCollection::Add(const BreakpointLocationSP &bp_loc) { @@ -179,3 +174,14 @@ void BreakpointLocationCollection::GetDescription( (*pos)->GetDescription(s, level); } } + +BreakpointLocationCollection &BreakpointLocationCollection::operator=( + const BreakpointLocationCollection &rhs) { + if (this != &rhs) { + std::lock(m_collection_mutex, rhs.m_collection_mutex); + std::lock_guard<std::mutex> lhs_guard(m_collection_mutex, std::adopt_lock); + std::lock_guard<std::mutex> rhs_guard(rhs.m_collection_mutex, std::adopt_lock); + m_break_loc_collection = rhs.m_break_loc_collection; + } + return *this; +} |
