提交 6b91d407 编写于 作者: Y Yancey1989

revert variable mutex

上级 60d827a8
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <mutex> // NOLINT
#include <string> #include <string>
#include <typeindex> #include <typeindex>
#include <typeinfo> #include <typeinfo>
...@@ -39,8 +38,6 @@ class Variable { ...@@ -39,8 +38,6 @@ class Variable {
template <typename T> template <typename T>
T* GetMutable() { T* GetMutable() {
// TODO(Yancey1989): need to make Variable completely thread-safe.
std::unique_lock<std::mutex> lock(mutex_);
if (!IsType<T>()) { if (!IsType<T>()) {
holder_.reset(new PlaceholderImpl<T>(new T())); holder_.reset(new PlaceholderImpl<T>(new T()));
} }
...@@ -93,7 +90,6 @@ class Variable { ...@@ -93,7 +90,6 @@ class Variable {
// by its address but not the unreadable name. // by its address but not the unreadable name.
friend class Scope; friend class Scope;
const std::string* name_; const std::string* name_;
std::mutex mutex_;
}; };
} // namespace framework } // namespace framework
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册