forked from OSchip/llvm-project
[Reproducers] Fix data race found by tsan
This fixes a data race uncovered by tsan during destruction of the GDBRemoteReplay server. The solution is to lock the thread state mutex when receiving packets. llvm-svn: 356168
This commit is contained in:
parent
702411fc29
commit
fa3f6401da
|
@ -55,6 +55,8 @@ GDBRemoteCommunicationReplayServer::~GDBRemoteCommunicationReplayServer() {
|
|||
GDBRemoteCommunication::PacketResult
|
||||
GDBRemoteCommunicationReplayServer::GetPacketAndSendResponse(
|
||||
Timeout<std::micro> timeout, Status &error, bool &interrupt, bool &quit) {
|
||||
std::lock_guard<std::recursive_mutex> guard(m_async_thread_state_mutex);
|
||||
|
||||
StringExtractorGDBRemote packet;
|
||||
PacketResult packet_result = WaitForPacketNoLock(packet, timeout, false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue