harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2264) [drlvm] race condition in ClassLoader::LookupLoader
Date Wed, 22 Nov 2006 12:40:04 GMT
[drlvm] race condition in ClassLoader::LookupLoader
---------------------------------------------------

                 Key: HARMONY-2264
                 URL: http://issues.apache.org/jira/browse/HARMONY-2264
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Alexey Varlamov
            Priority: Minor


The ClassLoader::LookupLoader() can potentially create duplicate native structures for the
same Java classloader instance.

ClassLoader* ClassLoader::LookupLoader( ManagedObject* loader )
{
    if( !loader ) return NULL;
    ClassLoader *cl = FindByObject( loader );
    if( cl )
        return cl;
    else
        return AddClassLoader( loader );
}

It is possible that concurrent threads request this method simultaneously and AddClassLoader
can be called several times for the same loader instance.

BTW, It seems more logical and clean to declare this method (and a bunch of other static methods
re Java-native loaders mapping) in UserDefinedClassLoader class, rather than in common ClassLoader.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message