Skip to content

Commit

Permalink
Fixed temporary lock_guard instances. (apache#7199)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalman5 authored and tkonolige committed Jan 11, 2021
1 parent 8b82b6c commit 133e864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/target/generic_func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
Expand All @@ -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;
Expand Down

0 comments on commit 133e864

Please sign in to comment.