fix: add missing lock in MapOperationsStorage::getInfoForHostPtr

https://github.com/intel/compute-runtime/issues/640
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-04-25 09:50:43 +02:00
committed by Compute-Runtime-Automation
parent 21e8595fef
commit 04afb63717
2 changed files with 53 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -105,6 +105,7 @@ MapOperationsHandler *NEO::MapOperationsStorage::getHandlerIfExists(cl_mem memOb
}
bool NEO::MapOperationsStorage::getInfoForHostPtr(const void *ptr, size_t size, MapInfo &outInfo) {
std::lock_guard<std::mutex> lock(mutex);
for (auto &entry : handlers) {
if (entry.second.findInfoForHostPtr(ptr, size, outInfo)) {
return true;