Duplicate :
|
Name: dkR10031 Date: 11/27/2002 After AudioSystem.getMixerInfo() method invocation, a thread which waits for notification does not allow to complete class execution. The JDK 2 SE 1.4 API specification does not state what should notify the thread created or used by AudioSystem.getMixerInfo(): "getMixerInfo public static Mixer.Info[] getMixerInfo() Obtains an array of mixer info objects that represents the set of audio mixers that are currently installed on the system. Returns: an array of info objects for the currently installed mixers. If no mixers are available on the system, an array of length 0 is returned." The bug is found in JDK build 1.4.2-beta-b07, and reproduced with JDK 1.3.0, JDK 1.3.1, JDK 1.4.0, JDK 1.4.1 and all JDK 1.4.2-beta builds. To reproduce the bug run the following test with JDK build 1.4.2-beta-b07, wait for 3 minutes and press ctrl+\: ------------------------------------------------------------------------ import javax.sound.sampled.*; public class MyMusic{ public static void main(String args[]){ System.out.println("We are trying to get informations:"); Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); System.out.println("The movie is over! Where is exit?"); } } -----------------------------Logs--------------------------------------- We are trying to get informations: The movie is over! Where is exit? Full thread dump Java HotSpot(TM) Client VM (1.4.2-beta-b07 mixed mode): "DestroyJavaVM" prio=1 tid=0x08052f50 nid=0x5246 waiting on condition [0..bfffd4 7c] "Java Sound event dispatcher" prio=1 tid=0x0810c188 nid=0x524f in Object.wait() [4cf22000..4cf228b8] at java.lang.Object.wait(Native Method) - waiting on <0x446c2e70> (a com.sun.media.sound.EventDispatcher) at java.lang.Object.wait(Object.java:426) at com.sun.media.sound.EventDispatcher.dispatchEvents(EventDispatcher.ja va:292) - locked <0x446c2e70> (a com.sun.media.sound.EventDispatcher) at com.sun.media.sound.EventDispatcher.run(EventDispatcher.java:343) at java.lang.Thread.run(Thread.java:536) "Signal Dispatcher" daemon prio=1 tid=0x0809ffe0 nid=0x524c waiting on condition [0..0] "Finalizer" daemon prio=1 tid=0x0808b310 nid=0x524a in Object.wait() [4c874000.. 4c8748b8] at java.lang.Object.wait(Native Method) - waiting on <0x44690490> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked <0x44690490> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) "Reference Handler" daemon prio=1 tid=0x0808a6c0 nid=0x5249 in Object.wait() [4c 7f3000..4c7f38b8] at java.lang.Object.wait(Native Method) - waiting on <0x44690380> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:426) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113) - locked <0x44690380> (a java.lang.ref.Reference$Lock) "VM Thread" prio=1 tid=0x080874a0 nid=0x5248 runnable "VM Periodic Task Thread" prio=1 tid=0x080a26f8 nid=0x524e waiting on condition "Suspend Checker Thread" prio=1 tid=0x0809f5f8 nid=0x524b runnable ------------------------------------------------------------------------- ======================================================================