<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def join(self):
 """ Waits until the state finished execution. """

        if self.thread:
            self.thread.join()
            self.thread = None
        else:
            logger.debug("Cannot join {0}, as the state hasn't been started, yet or is already finished!".format(self))