4 ms·
That requires an acquire on every access, so it's generally slower.
by andralex 13y ago
That requires an acquire on every access, so it's generally slower.
- brazzy 13y agoNo, it doesn't. The JVM guarantees class initialization to be threadsafe (the lock is implicit), so you don't need mutual exclusion to access the reference - it's initialized before any thread could attempt to access it.