[lldb] Fix ThreadList assignment race (#98293)
ThreadList uses the Process mutex to guard its state. This means its not possible to safely modify its process member, as the member is required to lock the mutex. Fortunately for us, we never actually need to change the process member (we always just juggle different kinds of thread lists belonging to the same process). This patch replaces the process member assignment (which is technically a race even when it assigns the same value) with an assertion. Since all this means that the class can never change its process member value (and it also must be non-null at all times), I've also changed the member type to a reference.
This commit is contained in:
1 parent
eb977399de
commit
e1bd337865
4 files changed
+41
-40
No files matched your search
@@ -372,7 +372,7 @@ lldb::ThreadSP OperatingSystemPython::CreateThread(lldb::tid_t tid,
|
||||
|
||||
std::vector<bool> core_used_map;
|
||||
if (thread_info_dict) {
|
||||
ThreadList core_threads(m_process);
|
||||
ThreadList core_threads(*m_process);
|
||||
ThreadList &thread_list = m_process->GetThreadList();
|
||||
bool did_create = false;
|
||||
ThreadSP thread_sp(
|
||||
|
||||
Reference in new issue
Block a user