B4J Question java.lang.RuntimeException: Resumable sub already completed

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Sorry not today. Just started prep for Colonostopy - getting ready to be on the shitter all evening. So much fun getting old
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Good luck with your test.

This error happens when you wait for a ResumableSub object after the sub already completed.

Example:
B4X:
    Dim rs As ResumableSub = Test
   Sleep(0) '<---- remove and it will work
   Wait For (rs) Complete (Success As Boolean)

Sub Test As ResumableSub
   Return True
End Sub

It should never happen if you run the sub and immediately wait for it to complete.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Tests not as good as I would like. Need to see some other doctors. Getting old (wait, I'm 67), Being Old SUCKS sometimes.

That seems to work but the reason I had it was because I now get this error: (will start a new thread)

java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)
at java.util.LinkedList$ListItr.next(LinkedList.java:888)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:132)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:84)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1072)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
 
Upvote 0
Top