Implemented LoopThread class.