I have to call some static java methods from c.
SOME-C-CODE
(*g_env)->CallStaticVoidMethodA(g_env, g_obj, g_mid, val);
SOME-C-CODE
(*g_env)->CallStaticVoidMethodA(g_env, g_obj, g_mid, val);
SOME-C-CODE
(*g_env)->CallStaticVoidMethodA(g_env, g_obj, g_mid, val);
SOME-C-CODE
I have to call java methods several times at different places. But the code executes all the java methods first and then comes to executing the native code. Please tell me how I can run the code in the execution sequence required ?
P.S. I've cached the jvm, jobject and jmethod and attaching them to current thread using AttachCurrentThread and DetachCurrentThread