Aborting thread?

BlitzMax Forums/BlitzMax Programming/Aborting thread?

orgos(Posted 2009) [#1]
Hi again :D

I have my thread for a progress loading like the bmax help, but i want to implement when the user close the app or press alt+f4 keys the application close, so i need to abort my actuall thread, how i can make it?

I are making a detachThread(mythread) but when the application close i have a windows error message.


ImaginaryHuman(Posted 2009) [#2]
Break up the code which the thread is executing into a number of small chunks which can be called many times to progress through its workload, and then when the user wants to exit, set some flag which the thread is looking for in its loop that causes it to stop.


orgos(Posted 2009) [#3]
Yes that was that i make, but the problem is when the process load a big file, that took some time to exit the game.


ImaginaryHuman(Posted 2009) [#4]
So don't do it all at once. Do it in chunks.