This is file implemented the functionality to control looping thread