diff --git a/src/target/generic_func.cc b/src/target/generic_func.cc index 16e5a5f9cdc60..5dbceec32ed79 100644 --- a/src/target/generic_func.cc +++ b/src/target/generic_func.cc @@ -51,7 +51,7 @@ struct GenericFunc::Manager { GenericFunc GenericFunc::Get(const std::string& name) { Manager* m = Manager::Global(); - std::lock_guard(m->mutex); + std::lock_guard lock(m->mutex); auto it = m->fmap.find(name); if (it == m->fmap.end()) { auto f = make_object(); @@ -66,7 +66,7 @@ GenericFunc GenericFunc::Get(const std::string& name) { void GenericFunc::RegisterGenericFunc(GenericFunc func, const std::string& name) { Manager* m = Manager::Global(); - std::lock_guard(m->mutex); + std::lock_guard lock(m->mutex); auto it = m->fmap.find(name); ICHECK(it == m->fmap.end()) << "GenericFunc already registered " << name; func->name_ = name;