[Lldb-commits] [PATCH] D154271: [lldb] Fix data race when interacting with python scripts

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Jul 1 10:59:25 PDT 2023


mib added a comment.

In D154271#4466339 <https://reviews.llvm.org/D154271#4466339>, @JDevlieghere wrote:

> In D154271#4466170 <https://reviews.llvm.org/D154271#4466170>, @bulbazord wrote:
>
>> Making `m_lock_count`'s type into `std::atomic<uint32_t>` makes sense to me, but I'm a little confused about why `Process::LoadOperatingSystemPlugin` is guarded by acquiring `m_thread_mutex`. My (admittedly limited) understanding of that is that it's a mutex that the Process holds for the ThreadList to manage concurrent modifications to the thread list. Is loading an Operating System plugin related to modifying the ThreadList? If not, perhaps it would be better served by having its own mutex?
>
> Yes, the OS plugins are named somewhat confusingly, but their purpose is to allow an operating systems (e.g. XNU) to specify threads when doing system level debugging, where otherwise we'd have just one thread per core.

@bulbazord I understand the confusion regarding `OperatingSystem` but it's used for "OS Thread Plugins", a way to mock a thread using python script, so it does change the `ThreadList`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154271/new/

https://reviews.llvm.org/D154271



More information about the lldb-commits mailing list