Add lock to downloading allocations on tbx

When running multiple threads, one thread could clear
allocationsForDownload while another was iterating over it.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-02-15 14:57:50 +00:00
committed by Compute-Runtime-Automation
parent 60d6505932
commit e0c892ed55
3 changed files with 13 additions and 1 deletions

View File

@@ -485,6 +485,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::flushSubmissionsAndDownloadAllocatio
pollAddress = ptrOffset(pollAddress, this->postSyncWriteOffset);
}
auto lockCSR = this->obtainUniqueOwnership();
for (GraphicsAllocation *graphicsAllocation : this->allocationsForDownload) {
downloadAllocation(*graphicsAllocation);
}
@@ -555,6 +556,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::downloadAllocations() {
}
pollAddress = ptrOffset(pollAddress, this->postSyncWriteOffset);
}
auto lockCSR = this->obtainUniqueOwnership();
for (GraphicsAllocation *graphicsAllocation : this->allocationsForDownload) {
downloadAllocation(*graphicsAllocation);
}