Robert Lougher wrote:
So to be compliant I've got to use a separate JNIEnv for each thread,
but there's no point putting anything in it, because it'll break with
the gtk code :)

No, I don't think the VM has to use different JNIEnv * pointers for different threads. But it may. The point is that the onus is on the native code to use the one provided by the VM consistently with that same thread, no matter what the VM does. The VM is the "master" and the native code is the "slave" in other words.

For example, the VM could have a single JNIEnv * pointer, and then
use pthread_getspecific() at each crossing into/out of native code
to determine which thread it's actually dealing with.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


_______________________________________________ Classpath mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to