Commit 58b0e702 by 王祖波

双重锁防止多次初始化

parent 86fd2c49
...@@ -80,7 +80,11 @@ public class HoloDataSource implements InitializingBean, DisposableBean { ...@@ -80,7 +80,11 @@ public class HoloDataSource implements InitializingBean, DisposableBean {
public HoloClient getClient() { public HoloClient getClient() {
if (this.client == null) { if (this.client == null) {
this.init(); synchronized (this) {
if (this.client == null) {
this.init();
}
}
} }
return this.client; return this.client;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment