I am using CPP and i want to implement timeout mechanism.
Form Example, function called "foo()" which will just trigger one function to execute after some timeout and it will return.
Why i need this?
I have one Android application which uses one CPP library (using JNI interface) in that lib there are some functions which takes time to process. I can't call these functions in separate thread (either from java or CPP as lib limitations) and because of that i get ANR in android application.
So what i will do, i will call one function in CPP layer using JNI which will start one timer and will return so that UI thread in android will not give ANR and when this timer is timed out it will call that time taking function and when processing is done it will inform the java layer.
How should i implement this?