United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4668511 Deadlock in JColorChooser
JDK-4668511 : Deadlock in JColorChooser

Details
Type:
Bug
Submit Date:
2002-04-15
Status:
Closed
Updated Date:
2002-06-13
Project Name:
JDK
Resolved Date:
2002-04-27
Component:
client-libs
OS:
windows_nt
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.1 (hopper)

Related Reports

Sub Tasks

Description
There is a problem with JColorChooser that can cause an entire GUI application to freeze permanently.

To reproduce:

Run SwingSet2.
Switch to the JColorChooser demo.
Switch to the HSB tab.
Click on the "S" radiobutton repeatedly.
The entire application freezes.

                                    

Comments
EVALUATION

The problem is that DefaultHSBChooserPanel re-uses its AbstractHSBImages with new ImageIcons. AbstractHSBImages have the concept of being dirty. When not dirty, their computeRow method will wait() until they are dirty before generating more data. Now, when multiple ImageIcons are created to use the same AbstractHSBImage, the AbstractHSBImage creates a Thread to produce data for each consumer. When it is set to be dirty, all threads wake up, one begins processing, but then sets it back to dirty. The other threads therefore wait again. Thus the GUI freezes.

I have changed DefaultHSBChooserPanel such that the same ImageIcons are used throughout most of the life of the JColorChooser and each one has its own producer thread. These objects are destroyed (and threads stopped) only when the component is made undisplayable (if it is made displayable again then they are re-created). I have basically made sure that there is always a one-to-one correspondence between image consumers (ImageIcon in this case) and image producer threads.

###@###.### 2002-04-15
                                     
2002-04-15
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
hopper

FIXED IN:
hopper

INTEGRATED IN:
hopper

VERIFIED IN:
hopper-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together