提交 54cb6073 编写于 作者: G guide

Merge github.com:Snailclimb/guide-rpc-framework

......@@ -18,7 +18,10 @@ public final class SingletonFactory {
public static <T> T getInstance(Class<T> c) {
String key = c.toString();
Object instance;
Object instance = OBJECT_MAP.get(key);
if (instance != null){
return c.cast(instance);
}
synchronized (SingletonFactory.class) {
instance = OBJECT_MAP.get(key);
if (instance == null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册