JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) { cached_jvm = jvm; /* cache the JavaVM pointer */ return JNI_VERSION_1_2; } static void Some_Function() { (*cached_jvm)->AttachCurrentThread(cached_jvm, &env, NULL); (*env)->MonitorEnter(env, callbackInst); jclass cls = (*env)->GetObjectClass(env, callbackInst); jmethodID id = (*env)->GetMethodID(env, cls, "callback", "(I)V"); (*env)->CallVoidMethod(env, callbackInst, id, (int)l); (*env)->MonitorExit(env, callbackInst); }
2011/11/22
Get Thread JNIEnv
This is an example shows how:
Subscribe to:
Post Comments (Atom)
Post Code on Blogger
Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...
-
Explain There is not interrupt PIN for PCIe interrupt. When device wants to raise an interrupt, an interrupt message is sent to host via ...
-
Configure Space Addressing One of the major improvements the PCI Local Bus had over other I/O architectures was its configuration mechanism...
-
What is LMA and VMA Every loadable or allocatable output section has two addresses. The first is the VMA, or virtual memory address. This ...
No comments:
Post a Comment