Skip to content

Commit

Permalink
double check lock
Browse files Browse the repository at this point in the history
  • Loading branch information
diguage committed Jul 6, 2020
1 parent 11e728c commit d15afba
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ public class DubboBootstrap extends GenericEventListener {
/**
* See {@link ApplicationModel} and {@link ExtensionLoader} for why DubboBootstrap is designed to be singleton.
*/
public static synchronized DubboBootstrap getInstance() {
public static DubboBootstrap getInstance() {
if (instance == null) {
instance = new DubboBootstrap();
synchronized (DubboBootstrap.class) {
if (instance == null) {
instance = new DubboBootstrap();
}
}
}
return instance;
}
Expand Down

0 comments on commit d15afba

Please sign in to comment.