Optimisation: "Joining" a thread does all the work for you
Clean: Cleanup shutdown loop
Optimisation: Use global wait method

Don't use wait() - its not what you think it is