Why does DCL double check lock need two layers of judgment?

We know that DCL double lock is written as:

synchronized (SingletonLazy5.class) {
    if(null == singletonLazy) {
        singletonLazy = new SingletonLazy5();
    }
}
Mar.02,2021

because once the singletonLazy is initialized correctly, each visit to null = = singletonLazy must get false so that it will not be reinitialized. But we don't need to judge null = = singletonLazy by locking every time. So the purpose of dual locking is to successfully initialize the singletonLazy without triggering the locking operation.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e44187-43a01.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e44187-43a01.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?