Opinions?
How about "specification" instead? :-)
http://java.sun.com/docs/books/jni/html/design.html#10110
11.5.1 Organization of the JNIEnv Interface Pointer ... Because the JNIEnv interface pointer is thread-local, native code must not use the JNIEnv interface pointer belonging to one thread in another thread. Native code may use the JNIEnv pointer as a thread ID that remains unique for the lifetime of the thread.
Actually, it's even documented as a common pitfall:
http://java.sun.com/docs/books/jni/html/pitfalls.html#11233
10.14 Using the JNIEnv across Threads
The JNIEnv pointer, passed as the first argument to every native method, can only be used in the thread with which it is associated. It is wrong to cache the JNIEnv interface pointer obtained from one thread, and use that pointer in another thread. Section 8.1.4 explains how you can obtain the JNIEnv interface pointer for the current thread.
Etienne
-- Etienne M. Gagnon, Ph.D. http://www.info2.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Classpath mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath

