Thread should be set to true before being run.