Add mutex guard for s_unfire

This commit is contained in:
RipleyTom 2020-01-28 10:47:46 +01:00 committed by Ivan
parent ad8988afd3
commit 795bc5d52b
1 changed files with 6 additions and 2 deletions

View File

@ -718,9 +718,9 @@ struct MemoryManager : llvm::RTDyldMemoryManager
void registerEHFrames(u8* addr, u64 load_addr, std::size_t size) override
{
#ifdef _WIN32
// Lock memory manager
std::lock_guard lock(s_mutex);
#ifdef _WIN32
// Fix RUNTIME_FUNCTION records (.pdata section)
decltype(s_unwater)::value_type pdata_entry = std::move(s_unwater.front());
s_unwater.pop_front();
@ -784,7 +784,11 @@ struct MemoryManager2 : llvm::RTDyldMemoryManager
{
#ifndef _WIN32
RTDyldMemoryManager::registerEHFramesInProcess(addr, size);
s_unfire.push_front(std::make_pair(addr, size));
{
// Lock memory manager
std::lock_guard lock(s_mutex);
s_unfire.push_front(std::make_pair(addr, size));
}
#endif
}