@@ -24,7 +24,7 @@ BreakpointLocationCollection::BreakpointLocationCollection(bool preserving)
2424BreakpointLocationCollection::~BreakpointLocationCollection () = default ;
2525
2626void BreakpointLocationCollection::Add (const BreakpointLocationSP &bp_loc) {
27- std::lock_guard<std::mutex > guard (m_collection_mutex);
27+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
2828 BreakpointLocationSP old_bp_loc =
2929 FindByIDPair (bp_loc->GetBreakpoint ().GetID (), bp_loc->GetID ());
3030 if (!old_bp_loc.get ()) {
@@ -44,7 +44,7 @@ void BreakpointLocationCollection::Add(const BreakpointLocationSP &bp_loc) {
4444
4545bool BreakpointLocationCollection::Remove (lldb::break_id_t bp_id,
4646 lldb::break_id_t bp_loc_id) {
47- std::lock_guard<std::mutex > guard (m_collection_mutex);
47+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
4848 collection::iterator pos = GetIDPairIterator (bp_id, bp_loc_id); // Predicate
4949 if (pos != m_break_loc_collection.end ()) {
5050 if (m_preserving_bkpts) {
@@ -117,7 +117,7 @@ const BreakpointLocationSP BreakpointLocationCollection::FindByIDPair(
117117}
118118
119119BreakpointLocationSP BreakpointLocationCollection::GetByIndex (size_t i) {
120- std::lock_guard<std::mutex > guard (m_collection_mutex);
120+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
121121 BreakpointLocationSP stop_sp;
122122 if (i < m_break_loc_collection.size ())
123123 stop_sp = m_break_loc_collection[i];
@@ -127,7 +127,7 @@ BreakpointLocationSP BreakpointLocationCollection::GetByIndex(size_t i) {
127127
128128const BreakpointLocationSP
129129BreakpointLocationCollection::GetByIndex (size_t i) const {
130- std::lock_guard<std::mutex > guard (m_collection_mutex);
130+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
131131 BreakpointLocationSP stop_sp;
132132 if (i < m_break_loc_collection.size ())
133133 stop_sp = m_break_loc_collection[i];
@@ -168,7 +168,7 @@ bool BreakpointLocationCollection::ShouldStop(
168168}
169169
170170bool BreakpointLocationCollection::ValidForThisThread (Thread &thread) {
171- std::lock_guard<std::mutex > guard (m_collection_mutex);
171+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
172172 collection::iterator pos, begin = m_break_loc_collection.begin (),
173173 end = m_break_loc_collection.end ();
174174
@@ -180,7 +180,7 @@ bool BreakpointLocationCollection::ValidForThisThread(Thread &thread) {
180180}
181181
182182bool BreakpointLocationCollection::IsInternal () const {
183- std::lock_guard<std::mutex > guard (m_collection_mutex);
183+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
184184 collection::const_iterator pos, begin = m_break_loc_collection.begin (),
185185 end = m_break_loc_collection.end ();
186186
@@ -197,7 +197,7 @@ bool BreakpointLocationCollection::IsInternal() const {
197197
198198void BreakpointLocationCollection::GetDescription (
199199 Stream *s, lldb::DescriptionLevel level) {
200- std::lock_guard<std::mutex > guard (m_collection_mutex);
200+ std::lock_guard<std::recursive_mutex > guard (m_collection_mutex);
201201 collection::iterator pos, begin = m_break_loc_collection.begin (),
202202 end = m_break_loc_collection.end ();
203203
@@ -212,8 +212,10 @@ BreakpointLocationCollection &BreakpointLocationCollection::operator=(
212212 const BreakpointLocationCollection &rhs) {
213213 if (this != &rhs) {
214214 std::lock (m_collection_mutex, rhs.m_collection_mutex );
215- std::lock_guard<std::mutex> lhs_guard (m_collection_mutex, std::adopt_lock);
216- std::lock_guard<std::mutex> rhs_guard (rhs.m_collection_mutex , std::adopt_lock);
215+ std::lock_guard<std::recursive_mutex> lhs_guard (m_collection_mutex,
216+ std::adopt_lock);
217+ std::lock_guard<std::recursive_mutex> rhs_guard (rhs.m_collection_mutex ,
218+ std::adopt_lock);
217219 m_break_loc_collection = rhs.m_break_loc_collection ;
218220 }
219221 return *this ;
0 commit comments