Microsoft KB Archive/188446

= FIX: AFC Deadlock May Occur When Setting UIFrame's Cursor. =

Article ID: 188446

Article Last Modified on 11/17/2005

-

APPLIES TO


 * Microsoft Java Virtual Machine, when used with:
 * the hardware: Intel x86
 * Microsoft Software Development Kit for Java 2.01
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 4.0 128-Bit Edition

-



This article was previously published under Q188446



SYMPTOMS
AFC UIFrame may deadlock when using the setCursor method.



CAUSE
The deadlock occurs because UIFrame.setCursor is not correctly synchronized.



RESOLUTION
To work around this problem, put your calls to setCursor in a synchronized block.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Internet Explorer 4.01 SP1.



MORE INFORMATION
The UIComponent class has a getTreeLock method that should be used when you need to synchronize the underlying AWT component. UIFrame derives from UIComponent; therefore, you can use this method to make a thread-safe call to setCursor. Here is an example: synchronized (uiFrame.getTreeLock) { uiFrame.setCursor(Cursor.HAND_CURSOR); }

