[all-commits] [llvm/llvm-project] c82099: [lldb] Improve locking in PathMappingLists (NFC) (...
Jonas Devlieghere via All-commits
all-commits at lists.llvm.org
Fri Nov 1 16:38:35 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c8209943faeead43c6932c5ddcc69c9e9d1e4262
https://github.com/llvm/llvm-project/commit/c8209943faeead43c6932c5ddcc69c9e9d1e4262
Author: Jonas Devlieghere <jonas at devlieghere.com>
Date: 2024-11-01 (Fri, 01 Nov 2024)
Changed paths:
M lldb/include/lldb/Target/PathMappingList.h
M lldb/source/Target/PathMappingList.cpp
Log Message:
-----------
[lldb] Improve locking in PathMappingLists (NFC) (#114576)
In [D148380](https://reviews.llvm.org/D148380), Alex added locking to
PathMappingLists. The current implementation runs the callback under the
lock, which I don't believe is necessary. As far as I can tell, no users
of the callback are relying on the list not having been modified until
the callback is handled.
This patch implements my suggestion to unlock the mutex before the
callback. I also switched to a non-recursive mutex as I don't believe
the recursive property is needed. To make the class fully thread safe, I
did have to introduce another mutex to protect the callback members.
The motivation for this change is #114507. Specifically,
Target::SetExecutableModule calls Target::GetOrCreateModule, which
potentially performs path remapping, which in turns has a callback to
Target::SetExecutableModule.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list