Skip to content

Commit 515f64b

Browse files
Merge pull request #10443 from felipepiovezan/felipe/cherrypick_threadsafe_6.2
[lldb] Make `RegisterContextThreadMemory` thread safe (llvm#134469)
2 parents 42ba728 + 5ec4c1e commit 515f64b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ RegisterContextThreadMemory::RegisterContextThreadMemory(
2525
RegisterContextThreadMemory::~RegisterContextThreadMemory() = default;
2626

2727
void RegisterContextThreadMemory::UpdateRegisterContext() {
28+
std::lock_guard<std::mutex> lock(m_update_register_ctx_lock);
29+
2830
ThreadSP thread_sp(m_thread_wp.lock());
2931
if (thread_sp) {
3032
ProcessSP process_sp(thread_sp->GetProcess());

lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class RegisterContextThreadMemory : public lldb_private::RegisterContext {
9999
RegisterContextThreadMemory(const RegisterContextThreadMemory &) = delete;
100100
const RegisterContextThreadMemory &
101101
operator=(const RegisterContextThreadMemory &) = delete;
102+
103+
std::mutex m_update_register_ctx_lock;
102104
};
103105

104106
} // namespace lldb_private

0 commit comments

Comments
 (0)