Closing Lanes application
Aditya23456 opened this issue · comments
I have a main loop which spawns 4 lanes as threads. After spawning, threads and maybe after few hours of running, my main loop does not exit the entire program even after it hits os.Exit(). (Although I am not sure it hit os.Exit but all it had was collectgarbage() and then os.Exit()). I ran the program on terminal and tried to stop in between using Control+C but still it doesn't exit unit I kill the process with maybe a better signal from outside? Is there a clean way to stop the entire program? I am planning to add multiple lines like-
os.execute("fuser -k 7509/tcp;")
-- since I have one of the lanes thread running as a server binding to port 7509
os.execute("screen -X -S MONITOR quit;")
-- since I am running the program in a screen session with name MONITOR
and then
os.Exit()
-- Should i use something like os.Exit(9) or os.Exit(1)
Will this ensure a smooth exit?
Have you tried just calling break on the main loop?