How to shut down the asynchronous thread in script console

There is some good info on that here
Managing multiple asynchronous threads - Ignition - Inductive Automation Forum