llvm-project
edaded2a - [lldb] Fix data race on ValueObject's unique-id counter (#197809)

Commit
75 days ago
[lldb] Fix data race on ValueObject's unique-id counter (#197809) g_value_obj_uid is a file-scope static that hands out unique IDs to every ValueObject. It was a plain user_id_t, so concurrent SBTarget::FindGlobalVariables / EvaluateExpression calls raced on the increment. Make it std::atomic<user_id_t>. Prefix operator++ on std::atomic is already an atomic fetch_add that returns the new value, so the call sites are unchanged. Found by ThreadSanitizer as part of #197792.
Author
Parents
Loading