AnotherZjuturtle / Gitalk

For zjuturtle.com Gitalk system
1 stars 0 forks source link

JNI 的多线程回调 | zjuturtle's blog #42

Open AnotherZjuturtle opened 4 years ago

AnotherZjuturtle commented 4 years ago

https://zjuturtle.com/2020/01/25/jni-multithread-callback/

在工作中遇到一些 JNI 调用,这里记录一下。需求比较复杂,从 Java 端看,它需要向 JNI 传递一个 Interface 的回调接口对象,然后 JNI 内部去回调它。调用链是:JAVA->JNI->CPP->JAVA(回调)。从上层的 java 代码上看是这样子的