llvm-project
7380aebc - [lldb] Fix data race on Process::FindPlugin's unique-id counter (#197807)

Commit
96 days ago
[lldb] Fix data race on Process::FindPlugin's unique-id counter (#197807) g_process_unique_id is a function-local static used to hand out unique IDs to each Process. It was a plain uint32_t, so concurrent SBTarget::LoadCore / Target::CreateProcess calls raced on the increment. Make it std::atomic<uint32_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