lundi 23 mars 2015

Android: How to set a stop flag in native C thread from Java


In my NDK Android app, Java part runs native C code to perform intensive calculations. It does so by creating an AsyncTask worker object that runs the native code in a separate thread via the JNI. The Java GUI has a stop button and the native code has a variable which is used as a stop flag to abort a lengthy calculation.


How do I set the stop flag in the native code, running in a separate thread, when the stop button is pressed in the main GUI thread?





Aucun commentaire:

Enregistrer un commentaire