This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFC: Handling special cases during VM startup
Tom Tromey wrote:
> >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
>
> Gary> I propose changing _Jv_CreateJavaVM to set runtimeInitialized
> Gary> after initialization completes, and changing VMThrowable to
> Gary> use it. The attached patch does this.
>
> Gary> Comments?
>
> Could you look to see when runtimeInitialized was added -- and if
> there was some test case, give it a try? I'm a little worried that
> there might be a race case in this code and that moving the set of
> runtimeInitialized later will make it more likely to hit the race.
> Maybe we need to have some kind of synchronization here, I'm not
> sure.
http://gcc.gnu.org/ml/java-patches/2001-q4/msg00136.html is the commit
message. runtimeInitialized was added so _Jv_RegisterClassHookDefault
could work whether or not a VM was running. Note that as it stands
_Jv_RegisterClassHookDefault works correctly before _Jv_CreateJavaVM
is called, and it works correctly after _Jv_CreateJavaVM is called,
but it does not work correctly during _Jv_CreateJavaVM, at least, not
for the first bit. My patch fixes that as a side-effect :)
Cheers,
Gary