Backends/Kinc-HL/hl/src/std/sys_android.c
static JNIEnv* hl_android_jni_get_env(void)
{
	/* Always try to attach if calling from a non-attached thread */
	JNIEnv *env;
	if((*hl_java_vm)->AttachCurrentThread(hl_java_vm, &env, NULL) < 0) {
		LOGE("failed to attach current thread");
		return 0;
	}
	pthread_setspecific(hl_java_thread_key, (void*) env);

	return env;
}
/* Function to retrieve JNI environment, and dealing with threading */
Function to retrieve JNI environment, and dealing with threading
Function to retrieve JNI environment and dealing with threading
static JNIEnv* hl_android_jni_get_env(void)
{
	JNIEnv *env;
	if((*hl_java_vm)->AttachCurrentThread(hl_java_vm, &env, NULL) < 0) {
		LOGE("failed to attach current thread");
		return 0;
	}
	pthread_setspecific(hl_java_thread_key, (void*) env);
	return env;
}
static JNIEnv * hl_android_jni_get_env ( void ) { JNIEnv * env ; if ( ( * hl_java_vm ) -> AttachCurrentThread ( hl_java_vm , & env , NULL ) < 0 ) { LOGE ( " " ) ; return 0 ; } pthread_setspecific ( hl_java_thread_key , ( void * ) env ) ; return env ; }
Function to retrieve JNI environment, and dealing with threading
Function to retrieve JNI environment and dealing with threading
/* Always try to attach if calling from a non-attached thread */