bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug awt/30122] Deadlock in Component.getFont()


From: roman at kennke dot org
Subject: [Bug awt/30122] Deadlock in Component.getFont()
Date: 8 Dec 2006 21:08:04 -0000


------- Comment #2 from roman at kennke dot org  2006-12-08 21:08 -------
A little hint might be helpful. I've tripped over similar issues from time to
time. It is generally a good idea to think about in which order which monitors
are entered. Usually it solves the deadlock when you enter the monitor in the
right order. Suppose you have the following situation (where TL is the AWT
treelock and OL is some other lock):

thread1:  ---> TL ---> OL -->
thread2:  ---> OL ---> TL -->

This is where you get a deadlock when t2 tries to enter the tree lock, e.g. in
getFont(). To solve this problem you'd do the following:

thread1:  ---> TL ---> OL -->
thread2:  ---> TL ---> OL ---> TL -->

that means so first grab the tree lock, then whatever other lock you grab and
then call getFont().


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30122





reply via email to

[Prev in Thread] Current Thread [Next in Thread]