You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2021/01/04 14:40:12 UTC

[tvm] branch main updated: Fixed temporary lock_guard instances. (#7199)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 7053235  Fixed temporary lock_guard instances. (#7199)
7053235 is described below

commit 705323592b49e8971c70e46d604e85635438f16d
Author: Gaetano <me...@gmail.com>
AuthorDate: Mon Jan 4 15:39:54 2021 +0100

    Fixed temporary lock_guard instances. (#7199)
---
 src/target/generic_func.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/target/generic_func.cc b/src/target/generic_func.cc
index 16e5a5f..5dbceec 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<std::mutex>(m->mutex);
+  std::lock_guard<std::mutex> lock(m->mutex);
   auto it = m->fmap.find(name);
   if (it == m->fmap.end()) {
     auto f = make_object<GenericFuncNode>();
@@ -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<std::mutex>(m->mutex);
+  std::lock_guard<std::mutex> lock(m->mutex);
   auto it = m->fmap.find(name);
   ICHECK(it == m->fmap.end()) << "GenericFunc already registered " << name;
   func->name_ = name;