This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/JVMTI] Better env list locking


Tom Tromey wrote:

Keith> Comments/questions/concerns?

Can post_event or any callback it calls possibly throw an exception?
If so that will leave the lock held.

If not this is ok. Thanks.

That's a really good question. The JVMTI specification does talk about dealing with exceptions that occur during the event callback, but nothing particularly definitive about whether a callback is allowed to throw an exception:


"Any exception thrown during the execution of an event callback can overwrite any current pending exception in the current application thread. Care must be taken to preserve a pending exception when an event callback makes a JNI call that might generate an exception."

From what I read into this, it sounds more like it is up to the agent to deal with exceptions properly, not the JVMTI implementation. But then perhaps a bit of defensive programming might not hurt? Catch any exceptions, release the lock, and rethrow the exception?

I don't really know. I could go either way, really. Your call, Mr. Maintainer. :-)

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]