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

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -87,8 +87,14 @@ struct MockTbxCsrRegisterDownloadedAllocations : TbxCommandStreamReceiverHw<GfxF
void flushTagUpdate() override {
flushTagCalled = true;
}
std::unique_lock<CommandStreamReceiver::MutexType> obtainUniqueOwnership() override {
obtainUniqueOwnershipCalled++;
return TbxCommandStreamReceiverHw<GfxFamily>::obtainUniqueOwnership();
}
std::set<GraphicsAllocation *> downloadedAllocations;
bool flushBatchedSubmissionsCalled = false;
bool flushTagCalled = false;
size_t obtainUniqueOwnershipCalled = 0;
};
} // namespace NEO