<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def terminate(self):
 """Signal runner to stop and join thread."""

        self.toggle_scan(False)
        self.keep_going = False
        self.join()