fix: change mutex when destroying allocation

Current mutex is not preventing destroying resources
when trim callback is currently evicting same allocation.
New mutex does.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-08-28 09:25:52 +00:00
committed by Compute-Runtime-Automation
parent c645e142b9
commit 7628966f80

View File

@@ -720,7 +720,7 @@ void WddmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation
auto &registeredEngines = getRegisteredEngines(gfxAllocation->getRootDeviceIndex());
for (auto &engine : registeredEngines) {
auto &residencyController = static_cast<OsContextWin *>(engine.osContext)->getResidencyController();
auto lock = residencyController.acquireLock();
auto lock = residencyController.acquireTrimCallbackLock();
auto &evictContainer = engine.commandStreamReceiver->getEvictionAllocations();
auto iter = std::find(evictContainer.begin(), evictContainer.end(), gfxAllocation);
if (iter != evictContainer.end()) {