From 1137ebf3b9a82d6967df343d7b3c0c8669405784 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 31 Oct 2022 10:13:06 +0800 Subject: [PATCH] fix(imperative): fix the tensor info lock in worker GitOrigin-RevId: d2fb4f8cc4cce45df0c11221b2b5554f9c41311c --- imperative/src/impl/interpreter/interpreter_impl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imperative/src/impl/interpreter/interpreter_impl.cpp b/imperative/src/impl/interpreter/interpreter_impl.cpp index 0f3df5529..1c11b9370 100644 --- a/imperative/src/impl/interpreter/interpreter_impl.cpp +++ b/imperative/src/impl/interpreter/interpreter_impl.cpp @@ -710,6 +710,7 @@ ChannelImpl::~ChannelImpl() { void ChannelImpl::produce_tensor(TensorInfo* dest, TensorPtr ptr) { auto& state = get_worker_state(); MGB_LOCK_GUARD(m_mutex); + MGB_LOCK_GUARD(m_info_spin); m_dtr.update_used_time(dest); MGB_RECORD_EVENT( TensorProduceEvent, dest->id, ptr->layout(), ptr->comp_node(), -- GitLab