rsx: Fix deadlock in vm::_page_unmap

This commit is contained in:
Elad Ashkenazi 2022-05-30 01:05:42 +03:00 committed by Ivan
parent 8b6f68abcf
commit 95233b5299

View File

@ -2949,14 +2949,14 @@ namespace rsx
}
}
// Pause RSX thread momentarily to handle unmapping
eng_lock elock(this);
// Queue up memory invalidation
std::lock_guard lock(m_mtx_task);
const bool existing_range_valid = m_invalidated_memory_range.valid();
const auto unmap_range = address_range::start_length(address, size);
// Pause RSX thread momentarily to handle unmapping
eng_lock elock(this);
if (existing_range_valid && m_invalidated_memory_range.touches(unmap_range))
{
// Merge range-to-invalidate in case of consecutive unmaps