Native Extensions

Looks like I am right and the issue is in multithreading.

I see that you solved the same issue using array of MessageCommand (your own stack of callbacks) - it looks like a plan.

I’ll try to make something like this in my native extension, thank you!

I was bewildered because the same code works good on ios. But on ios all callbacks works using dispatch_async(dispatch_get_main_queue() … (in SDK) and i think that the reason why it works without any problem.
But strange that on Android all callbacks run with runOnUiThread methods (in SDK), but it not helps.

I’ll try to check thread ids and understand why it not helps.

UPD:
I made stack of callbacks and push them to lua by update method. All works fine. Thank you @Mathias_Westerdahl for the help

3 Likes