diff --git a/level_zero/core/source/device/bcs_split.cpp b/level_zero/core/source/device/bcs_split.cpp index ce741eec42..06d56c564b 100644 --- a/level_zero/core/source/device/bcs_split.cpp +++ b/level_zero/core/source/device/bcs_split.cpp @@ -115,6 +115,7 @@ std::vector &BcsSplit::getCmdQsForSplit(NEO::TransferDirection d } size_t BcsSplit::Events::obtainForSplit(Context *context, size_t maxEventCountInPool) { + std::lock_guard lock(this->mtx); for (size_t i = 0; i < this->marker.size(); i++) { auto ret = this->marker[i]->queryStatus(); if (ret == ZE_RESULT_SUCCESS) { diff --git a/level_zero/core/source/device/bcs_split.h b/level_zero/core/source/device/bcs_split.h index 9fe81e9884..22e542e3f0 100644 --- a/level_zero/core/source/device/bcs_split.h +++ b/level_zero/core/source/device/bcs_split.h @@ -37,6 +37,7 @@ struct BcsSplit { struct Events { BcsSplit &bcsSplit; + std::mutex mtx; std::vector pools; std::vector barrier; std::vector subcopy;