I don’t believe this is related to threading. In your sample code you have loc:ret = subprocedure(). This is not starting a new thread.
The ABC file manager is restoring the record buffer for the table when the file is closed in the subprocedure.
Add this line in your subprocedure after the files are opened.
This tells the file manager that you want to record buffer for the table to be left as it is for the calling procedure to use.