[Lldb-commits] [PATCH] D157041: [lldb] Protect OptionValue accesses from data races
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 4 09:11:40 PDT 2023
aprantl added inline comments.
================
Comment at: lldb/source/Interpreter/OptionValue.cpp:55
const OptionValueBoolean *OptionValue::GetAsBoolean() const {
+ std::lock_guard<std::recursive_mutex> lock(m_mutex);
if (GetType() == OptionValue::eTypeBoolean)
----------------
If you are following @kastiglione 's suggestion from above (I'd be fine with choosing symmetry over performance) then this method (and the ones below) also doesn't need any locks, since it just calls other thread-safe methods.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157041/new/
https://reviews.llvm.org/D157041
More information about the lldb-commits
mailing list