<AWT Dev> Review Request for 8065709: Deadlock in awt/logging apparently introduced by 8019623

mikhail cherkasov mikhail.cherkasov at oracle.com
Fri Jan 16 14:18:32 UTC 2015

Hi all,

JBS: https://bugs.openjdk.java.net/browse/JDK-8065709
Webrev: http://cr.openjdk.java.net/~mcherkas/8065709/webrev.00/

AppContext creation is guarder by getAppContextLockand, but during 
AppContext creation
we also call EventQueue initialization, during EQ initialization logger 
initialization happens
it acquires "javaAwtAccess".  if "javaAwtAccess" is acquired by other it 
can lead to deadlock:

T1                                                   T2
start AppContext  creation
                                                      acquire javaAwtAccess
acquire getAppContextLock
init EQ                                         call getAppContext
init Logger                                   waiting for getAppContextLock
waiting for javaAwtAccess

I applied the fix suggested in jbs comments by Petr.
I replaced eager logger initialization in EQ with lazy, so we won't 
invoke Logger
during EQ initialization as result no deadlock.


More information about the awt-dev mailing list