There is a sub which is time consuming. I try to make it a resumable sub but it is still making the UI not responsive.
So I use the Threading library to call the sub.
It works but on some devices, the th_Ended event is never triggered. One of my users is reporting this: https://github.com/xulihang/ImageTrans-docs/issues/1029
I can reproduce this on a Linux Virtual machine with limited CPU cores. It works fine on my regular macOS and Windows devices.
So I use the Threading library to call the sub.
B4X:
Private th As Thread
th.Initialise("th")
Dim map1 As Map
map1.Initialize
map1.Put("mat",Mat)
map1.Put("geometries",geometries)
th.Start(Me,"Detect",Array As Map(map1))
wait for th_Ended(endedOK As Boolean, error As String)
It works but on some devices, the th_Ended event is never triggered. One of my users is reporting this: https://github.com/xulihang/ImageTrans-docs/issues/1029
I can reproduce this on a Linux Virtual machine with limited CPU cores. It works fine on my regular macOS and Windows devices.