FULL PRODUCT VERSION : openjdk version "1.6.0-internal" OpenJDK Runtime Environment (build 1.6.0-internal-langel_02_jun_2008_10_58-b00) OpenJDK Server VM (build 10.0-b19, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux towel.yyz.redhat.com 2.6.25.6-55.fc9.i686 #1 SMP Tue Jun 10 16:27:49 EDT 2008 i686 i686 i386 GNU/Linux A DESCRIPTION OF THE PROBLEM : Triggering a beep using the default toolkit only works occasionally. This is because the awt is not unlocked/flushed properly. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Run test case a few times. beep will only occur intermittently depending on the XToolkit instance cached (See the hashcode of the Toolkit printed out). EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Beep should be heard every time the testcase is run. ACTUAL - Beep is not heard every time, only with certain cached instances of the toolkit. REPRODUCIBILITY : This bug can be reproduced often. ---------- BEGIN SOURCE ---------- import java.awt.*; public class beepTest { public static void main(String[] args) { System.out.println(Toolkit.getDefaultToolkit()); Toolkit.getDefaultToolkit().beep(); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Here is a patch: --- openjdk6.old/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2008-03-26 05:00:00.000000000 -0400 +++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2008-06-26 11:59:28.000000000 -0400 @@ -1097,7 +1097,7 @@ try { XlibWrapper.XBell(getDisplay(), 0); } finally { - awtUnlock(); + awtFUnlock(); } }
|