Skip to content

Commit d223864

Browse files
authored
Merge pull request Snailclimb#822 from huangshangi/master
Update the singleton pattern example
2 parents 90f1744 + 4ce02b6 commit d223864

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/java/Multithread/JavaConcurrencyAdvancedCommonInterviewQuestions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class Singleton {
7373
private Singleton() {
7474
}
7575

76-
public synchronized static Singleton getUniqueInstance() {
76+
public static Singleton getUniqueInstance() {
7777
//先判断对象是否已经实例过,没有实例化过才进入加锁代码
7878
if (uniqueInstance == null) {
7979
//类对象加锁

0 commit comments

Comments
 (0)