-
Bug
-
Resolution: Fixed
-
P1
-
1.2.0, 1.3.0
-
1.3
-
generic, x86
-
windows_95, windows_nt
-
Verified
The implementation of "cursor sync" causes deadlock on win32.
Run the following sample, try to move one frame to cover part of
another frame and keep using mouse to change position slightly,
the VM will hang up soon. Seems to me the calling of _un_shield_cursor()
in awt_Graphics.cpp is the one of reasons, try using PostMessage() in
both _shield_cursor() and _un_shield_cursor() should solve the problem...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class deadlock extends Panel implements KeyListener {
public static void main(String argv[]) {
Frame frame1 = new Frame("lightweight1");
Frame frame2 = new Frame("lightweight2");
deadlock dl1 = new deadlock("lightweight1");
//dl1.setSize(200,100);
frame1.add("Center", dl1);
frame1.setSize(200, 100);
deadlock dl2 = new deadlock("lightweight2");
//dl2.setSize(200,100);
frame2.add("Center", dl2);
frame2.setSize(200, 100);
WindowListener listener = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
e.getWindow().dispose();
System.exit(0);
};
};
frame1.addWindowListener(listener);
frame1.validate();
frame1.setVisible(true);
frame2.addWindowListener(listener);
frame2.validate();
frame2.setVisible(true);
}
String name;
char key;
public deadlock(String name) {
super();
this.name = name;
setSize(400, 60);
setBackground(Color.cyan);
setForeground(Color.black);
setVisible(true);
setEnabled(true);
addKeyListener(this);
}
public void paint(Graphics g) {
g.setColor(getBackground());
Dimension size = getSize();
g.fillRect(0, 0, size.width, size.height);
g.setColor(getForeground());
((Graphics2D)g).drawString(name + "==>" + key, 10, 20);
}
public void keyTyped(KeyEvent e){
key = e.getKeyChar();
paint(getGraphics());
}
public void keyPressed(KeyEvent e){}
public void keyReleased(KeyEvent e){}
}
Run the following sample, try to move one frame to cover part of
another frame and keep using mouse to change position slightly,
the VM will hang up soon. Seems to me the calling of _un_shield_cursor()
in awt_Graphics.cpp is the one of reasons, try using PostMessage() in
both _shield_cursor() and _un_shield_cursor() should solve the problem...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class deadlock extends Panel implements KeyListener {
public static void main(String argv[]) {
Frame frame1 = new Frame("lightweight1");
Frame frame2 = new Frame("lightweight2");
deadlock dl1 = new deadlock("lightweight1");
//dl1.setSize(200,100);
frame1.add("Center", dl1);
frame1.setSize(200, 100);
deadlock dl2 = new deadlock("lightweight2");
//dl2.setSize(200,100);
frame2.add("Center", dl2);
frame2.setSize(200, 100);
WindowListener listener = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
e.getWindow().dispose();
System.exit(0);
};
};
frame1.addWindowListener(listener);
frame1.validate();
frame1.setVisible(true);
frame2.addWindowListener(listener);
frame2.validate();
frame2.setVisible(true);
}
String name;
char key;
public deadlock(String name) {
super();
this.name = name;
setSize(400, 60);
setBackground(Color.cyan);
setForeground(Color.black);
setVisible(true);
setEnabled(true);
addKeyListener(this);
}
public void paint(Graphics g) {
g.setColor(getBackground());
Dimension size = getSize();
g.fillRect(0, 0, size.width, size.height);
g.setColor(getForeground());
((Graphics2D)g).drawString(name + "==>" + key, 10, 20);
}
public void keyTyped(KeyEvent e){
key = e.getKeyChar();
paint(getGraphics());
}
public void keyPressed(KeyEvent e){}
public void keyReleased(KeyEvent e){}
}
- duplicates
-
JDK-4197243 Mouse movements destroy the graphics
-
- Closed
-
-
JDK-4244816 Composition area may deadlock on Windows
-
- Closed
-
-
JDK-4249097 hotjava lock up when doing a vertical scroll
-
- Closed
-
-
JDK-4253416 Deadlock in AWT under Kestrel JRE
-
- Closed
-
- relates to
-
JDK-4224808 AWT deadlock on dual processor machine
-
- Resolved
-