If the first thread hasn’t finished initializing SomeClass, the second thread will block.
This is detailed in the Java Language Specification in section 12.4.2.
Related Contents:
- Volatile vs Static in Java
- Are non-synchronised static methods thread safe if they don’t modify static class variables?
- Are Java static initializers thread safe?
- Are static variables shared between threads?
- Running code in main thread from another thread
- What does java.lang.Thread.interrupt() do?
- What’s the difference between Thread start() and Runnable run()
- Why would a static nested interface be used in Java?
- Java: How to test methods that call System.exit()?
- How to catch an Exception from a thread
- What is the most frequent concurrency issue you’ve encountered in Java? [closed]
- IllegalMonitorStateException on wait() call
- What does this thread join code mean?
- Why is a static method considered a method?
- Behaviour of final static method
- How to wait for a number of threads to complete?
- What is mutex and semaphore in Java ? What is the main difference?
- Why should Java ThreadLocal variables be static
- How to start two threads at “exactly” the same time
- Green Threads vs Non Green Threads
- Is a HashMap thread-safe for different keys?
- Why is this class not thread safe?
- When should I use a CompletionService over an ExecutorService?
- Simplest and understandable example of volatile keyword in Java
- Is ExecutorService (specifically ThreadPoolExecutor) thread safe?
- Given that HashMaps in jdk1.6 and above cause problems with multi=threading, how should I fix my code
- How to debug a multi-threaded app in IntelliJ?
- “Parallel.For” for Java?
- Utility class in Spring application – should I use static methods or not?
- shutdown and awaitTermination which first call have any difference?
- Which Java thread is hogging the CPU?
- Blocking queue and multi-threaded consumer, how to know when to stop
- Forcing multiple threads to use multiple CPUs when they are available
- Java thread affinity
- Java Synchronized list
- Difference between javacore, thread dump and heap dump in Websphere
- ExecutorService vs ThreadPoolExecutor using LinkedBlockingQueue
- Thread.stop() – deprecated
- ReentrantReadWriteLock: what’s the difference between ReadLock and WriteLock?
- Mock static java methods using Mockk
- Android Studio threaded debugging
- Happens-before relationships with volatile fields and synchronized blocks in Java – and their impact on non-volatile variables?
- What does SwingUtilities.invokeLater do? [duplicate]
- Distinguishing between Java threads and OS threads?
- Call to method of static java.text.DateFormat not advisable?
- java.lang.IllegalMonitorStateException: object not locked by thread before wait()?
- Why synchronized method is not included in interface
- Utility of Future.cancel(boolean) method
- If statement with String comparison fails [duplicate]
- The web application appears to have started a thread named [Timer-0] but has failed to stop it