Code Review Request for 6977738

Mandy Chung mandy.chung at
Wed Sep 29 19:43:15 UTC 2010

  Alan, David,

I revise the fix including the following:
1. Use the lazy initialization holder class idiom to initialize the bcp
variable to simplify the synchronization.

2. Group the initialization of system properties in a new private method
System.initializeSystemProperties so that it can save a copy for internal
implementation use to address the deadlock issue and remove the
properties that are intended for private internal use from public access
before initializing the System.props.  This removes the 2 calls to

3. Reorder* in FILES_java.gmk

The new webrev is at:


On 09/16/10 16:30, Mandy Chung wrote:
> Fix 6977738: Deadlock between java.lang.ClassLoader and 
> java.util.Properties
> Webrev at:
> ClassLoader.getResource locking the system properties object is
> deadlock prone. For example, the 
> sun.misc.Launcher.getBootstrapClassPath()
> method is a synchronized method. A thread calling
> ClassLoader.getResource method attempts to synchronize on
> the system properties object while holding sun.misc.Launcher.class.
> It will deadlock if there is another thread is holding the monitor
> lock of the system properties object (e.g. calls the
> method) while it attempts to load a resource file.  In addition,
> ClassLoader.getResource may invoke the ZipFile initialization that
> also needs to get the system property.
> This fix caches the system properties at initialization so that
> the ZipFile and Launcher will read the system property from the
> private Properties object.  In addition, I make some minor
> changes in and storeToXML method to confine the
> synchronization needed and also have the DownloadManager to
> maintain its bootclasspath.
> Thanks
> Mandy

More information about the core-libs-dev mailing list