Posted By:
Erik_Lander
Posted On:
Sunday, November 23, 2003 12:38 PM
How do i register native functions so they can be used in multiple threads ( in native app ), this is what i'm trying to do void JNICALL native_func(...) { } DWORD WINAPI thread_func(...) { // Attach thread, find class etc env->CallStaticVoidMethod(someClass, mainFunc); } int main() { // init VM, find class etc JNINativeMethod nm; nm.name = "native_func"; nm.signature = "()V"; nm.fnPtr = native_fun; env->RegisterNatives(cls, &nm, 1);
More>>
How do i register native functions so they can be used in multiple threads ( in native app ), this is what i'm trying to do
void JNICALL native_func(...) { }
DWORD WINAPI thread_func(...)
{
// Attach thread, find class etc
env->CallStaticVoidMethod(someClass, mainFunc);
}
int main()
{
// init VM, find class etc
JNINativeMethod nm;
nm.name = "native_func";
nm.signature = "()V";
nm.fnPtr = native_fun;
env->RegisterNatives(cls, &nm, 1);
// spawn thread
}
I tried registering the native function in the thread to =/
<<Less