HomePhabricator

[lldb] Add missing mutex guards to TargetList::CreateTarget

Authored by teemperor on Mon, May 24, 10:16 AM.

Description

[lldb] Add missing mutex guards to TargetList::CreateTarget

TestMultipleTargets is randomly failing on the bots. The reason for that is that
the test is calling SBDebugger::CreateTarget from multiple threads.
TargetList::CreateTarget is curiously missing the guard that all of its other
member functions have, so all the threads in the test end up changing the
internal TargetList state at the same time and end up corrupting it.

Reviewed By: vsk, JDevlieghere

Differential Revision: https://reviews.llvm.org/D103020