"Signal Dispatcher" daemon prio=10 tid=0x00007f62440e9000 nid=0x72c0 waiting on condition "C2 CompilerThread0" daemon prio=10 tid=0x00007f62440eb000 nid=0x72c1 waiting on condition "C2 CompilerThread1" daemon prio=10 tid=0x00007f62440ee000 nid=0x72c2 waiting on condition "Thread-0" prio=10 tid=0x00007f624410d800 nid=0x72c5 in Object.wait() Īt ClassDeadlockTest$Super.getHelloString(ClassDeadlockTest.java:43)Īt ClassDeadlockTest$Super.(ClassDeadlockTest.java:32)Īt ClassDeadlockTest$1.run(ClassDeadlockTest.java:16)
![java deadlock java deadlock](https://csharpcorner-mindcrackerinc.netdna-ssl.com/UploadFile/fd0172/introduction-to-deadlock-in-java/Images/fig2.jpg)
![java deadlock java deadlock](https://www.scientecheasy.com/wp-content/uploads/2020/07/java-deadlock.png)
While main thread is waiting to load ClassDeadlockTest.Subįull thread dump Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode): JVM will deadlock with a thread in ClassDeadlockTest.Super. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try If you define a class with a static field that depends on a subclass of that class, there is an opportunity for deadlock when multiple threads try to load the class and its subclass.Ī search of the bug database gave two results, both somewhat old and closed as won't fix: Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
![java deadlock java deadlock](https://i1.wp.com/yellowcodebooks.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-05-at-2.19.53-PM.png)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) Java(TM) SE Runtime Environment (build 1.7.0_25-b15)