Re: Accessing a JNIEnv pointer from within a C++ jni function

2000-03-28 Thread Juergen Kreileder
> John Rousseau writes: John> On Tuesday Mar 28, 2000, Norman Shapiro wrote: >> The Java jni specifications require a JNIEnv* for almost all >> functions they provide. Furthermore it seems that if multiple >> Java threads can access the same function, each function call must

Re: Accessing a JNIEnv pointer from within a C++ jni function

2000-03-28 Thread Chris Kelly
IMHO, you have two options: either pass JNIEnv* to each level, or pass your C++ objects back to the top level, and use JNIEnv* on them there. The second option would avoid you having to make all your classes "JNI-aware". To avoid that with the first option, hide JNIEnv* in a struct or a class or a

Re: Accessing a JNIEnv pointer from within a C++ jni function

2000-03-28 Thread John Rousseau
On Tuesday Mar 28, 2000, Norman Shapiro wrote: > [EMAIL PROTECTED] (John Rousseau) writes: > >You could save the pointer in thread local storage, but I guarantee > >that it won't be portable. > > > >Take a look at pthread_key_create, pthread_setspecific, et al. > > > > Thanks much, that's exac

Re: Accessing a JNIEnv pointer from within a C++ jni function

2000-03-28 Thread John Rousseau
On Tuesday Mar 28, 2000, Norman Shapiro wrote: > The Java jni specifications require a JNIEnv* for almost all > functions they provide. Furthermore it seems that if multiple > Java threads can access the same function, each function call must > use the JNIEnv* from the current thread. > > Give

Accessing a JNIEnv pointer from within a C++ jni function

2000-03-28 Thread Norman Shapiro
The Java jni specifications require a JNIEnv* for almost all functions they provide. Furthermore it seems that if multiple Java threads can access the same function, each function call must use the JNIEnv* from the current thread. Given that function I am writing is maybe 20 deep in a call hiera