def wait_and_join ( self , task ) : while not task . has_started : time . sleep ( self . _polling_time ) task . thread . join ( )
thread hangs on join even though tasks are finished python3
Given a task waits for it until it finishes : param task : Task : return :
def wait_and_join(self, task):
        """ Given a task, waits for it until it finishes
        :param task: Task
        :return:
        """
        while not task.has_started:
            time.sleep(self._polling_time)
        task.thread.join()