This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH for a RegisterClass hook
"Anthony Green" <green@redhat.com> writes:
> Per wrote:
> > This patch allocs re-directing RegisterClass calls. This is necessary
> > when you want to have a ClassLoader manage the classes loaded in
> > a ClassLoader, as opposed to the default when the classes in a
> > shared library are entered into the global class name using the
> > system class loader.
>
> Shouldn't the function pointer somehow be a property of the ClassLoader
> instance, and not a global variable?
The problem is how? The hook is called via the shared library's init
section, which knows nothing about ClassLoaders. It is only used
while the dlopen is actually running, not while classes are loaded.
Access to the hook must be synchornized, as the comment says.
> Can't we have multiple class loaders on the go?
Yes, that's the point. However, we can't have multiple class loaders
being *initialized* or more specifically calling dlopen at the same time.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/