mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
Compute-Runtime-Automation

parent
60d6505932
commit
e0c892ed55
@ -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
|
||||
|
Reference in New Issue
Block a user