This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: invocation interface
- To: Cedric Berger <cedric at wireless-networks dot com>
- Subject: Re: invocation interface
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Wed, 16 May 2001 12:08:37 -0400 (EDT)
- cc: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>, java at gcc dot gnu dot org
On Wed, 16 May 2001, Cedric Berger wrote:
> > How is this done with JNI? The Sun JNI docs say DestroyJavaVM must not
> > be called until all non-main threads have terminated.
>
> Where did you get that?
I'm looking at
http://java.sun.com/j2se/1.3/docs/guide/jni/spec/invocation.doc.html#16089
"Only the main thread can unload the VM. The main thread must be the
only remaining user thread when it calls DestroyJavaVM()."
> Here is the relevent part of the doc:
>
> jint DestroyJavaVM(JavaVM *vm)
>
> The support for DestroyJavaVM was not complete in 1.1. Only the main thread may call DestroyJavaVM. In the Java 2 SDK, any thread,
> whether attached or not, can call this function. If the current thread is attached, the VM waits until the current thread is the
> only user-level Java thread. If the current thread is not attached, the VM attaches the current thread and then waits until the
> current thread is the only user-level thread. The Java 2 SDK still does not support VM unloading, however. DestroyJavaVM always
> returns an error code.
Hmm... that sounds more like our _Jv_ThreadWait. I wasn't aware that Sun
changed this part of the spec.
Jeff