Updated logic for Shutdown/Interrupting of the Threads.