Patch: FYI: JNI and synchronized native

Tom Tromey tromey@redhat.com
Wed Dec 12 21:09:00 GMT 2001


>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:

>> +  if (sync != NULL)
>> +    _Jv_MonitorExit (sync);

Jeff> I don't see a cleanup here.  What happens to the monitor if an
Jeff> exception is thrown from the called function?

The monitor remains held.  Obviously this would be bad.

Do we need to support the ability to throw a C++ exception from a JNI
call?  I would imagine this would break just about any JVM.  In this
context, Java exceptions can only be thrown via the appropriate JNI
call; we handle that case correctly.

Tom



More information about the Java-patches mailing list