1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-20 22:17:09 +08:00

Merge pull request #1 from huangshangi/huangshangi-patch-1

Update JavaConcurrencyAdvancedCommonInterviewQuestions.md
This commit is contained in:
huangshangi 2020-06-16 10:21:15 +08:00 committed by GitHub
commit 4ce02b681d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@ public class Singleton {
private Singleton() {
}
public synchronized static Singleton getUniqueInstance() {
public static Singleton getUniqueInstance() {
//先判断对象是否已经实例过,没有实例化过才进入加锁代码
if (uniqueInstance == null) {
//类对象加锁