Knowledge Base

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

Article ID: 188446

Article Last Modified on 11/17/2005


APPLIES TO


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);
   }
				

REFERENCES

For more information about Java developments at Microsoft, visit the following Microsoft Web site:

Additional query words: setCursor synchronized kbJAFC

Keywords: kbbug kbfix KB188446