Thread safety of static blocks in Java

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.

Leave a Comment