在 JNI(Java Native Interface)在多线程中的运用 一文中说到了
gs_jvm->AttachCurrentThread((void **)&env, NULL);
这个方法,今天在使用中就遇到了native thread exited without detaching这个问题,
原来是没有detach,所以用完之后一定要
(*gs_jvm)->DetachCurrentThread(gs_jvm);
否则就会在释放线程的时候遇到这个问题,特此记录。在 JNI(Java Native Interface)在多线程中的运用 一文中说到了
gs_jvm->AttachCurrentThread((void **)&env, NULL);
这个方法,今天在使用中就遇到了native thread exited without detaching这个问题,
原来是没有detach,所以用完之后一定要
(*gs_jvm)->DetachCurrentThread(gs_jvm);
否则就会在释放线程的时候遇到这个问题,特此记录。