BBA/HLE: Fix random PCAP file corruption

Concurrency between RecvHandlePacket and SendFromDirectFIFO
This commit is contained in:
Sepalani committed 2023-11-23 22:07:44 +04:00
1 parent aa1311cd78
commit 91020ac4fa
3 files changed
+6

No files matched your search

@@ -123,6 +123,9 @@ void PCAPSSLCaptureLogger::LogBBA(const void* data, std::size_t length)
{
if (!Config::Get(Config::MAIN_NETWORK_DUMP_BBA))
return;
// Concurrency between CEXIETHERNET's RecvHandlePacket and SendFromDirectFIFO
const std::lock_guard lock(m_io_mutex);
m_file->AddPacket(static_cast<const u8*>(data), length);
}