diff --git a/src/inference/src/dev/threading/cpu_streams_executor.cpp b/src/inference/src/dev/threading/cpu_streams_executor.cpp index bb47b813dce05f..e3e1379b6c26da 100644 --- a/src/inference/src/dev/threading/cpu_streams_executor.cpp +++ b/src/inference/src/dev/threading/cpu_streams_executor.cpp @@ -492,10 +492,10 @@ std::vector CPUStreamsExecutor::get_rank() { } void CPUStreamsExecutor::cpu_reset() { - if (!_impl->_cpu_ids_all.empty()) { - set_cpu_used(_impl->_cpu_ids_all, NOT_USED); - { - std::lock_guard lock(_impl->_cpu_ids_mutex); + { + std::lock_guard lock(_impl->_cpu_ids_mutex); + if (!_impl->_cpu_ids_all.empty()) { + set_cpu_used(_impl->_cpu_ids_all, NOT_USED); _impl->_cpu_ids_all.clear(); } } @@ -504,12 +504,6 @@ void CPUStreamsExecutor::cpu_reset() { CPUStreamsExecutor::CPUStreamsExecutor(const IStreamsExecutor::Config& config) : _impl{new Impl{config}} {} CPUStreamsExecutor::~CPUStreamsExecutor() { - try { - cpu_reset(); - } catch (const ov::Exception&) { - // Destructor should not throw - catch needed for static analysis. - OPENVINO_THROW("Reset CPU state error."); - } { std::lock_guard lock(_impl->_mutex); _impl->_isStopped = true;