开发者

how to synchronise data with JNI in android

开发者 https://www.devze.com 2023-02-10 05:32 出处:网络
I need to synchronize on a structure, which will be filled in native code(C code) and the开发者_Go百科 same will be read from the Java Code with JNI. I need to synchronize these. Is there any method I

I need to synchronize on a structure, which will be filled in native code(C code) and the开发者_Go百科 same will be read from the Java Code with JNI. I need to synchronize these. Is there any method I should use, something like the IPC mechanisms?


You can use the JNIEnv to acquire the monitor for a Java Object and therefor use the usual Java synchronization to synchronize.. More on the monitor entry and exit here

0

精彩评论

暂无评论...
验证码 换一张
取 消