diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Breakpoint/BreakpointLocationCollection.cpp | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
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; +} |