def call_run(): # As soon as the thread is done, break the circular reference. try: self.run() finally: self.__thread = None _thread._remove_thread_id(self.ident)
def join(self, timeout = None): # We don't support a timed join here, sorry. assert timeout is None thread = self.__thread if thread is not None: thread.join() # Clear the circular reference. self.__thread = None _thread._remove_thread_id(self.ident)
def join(self, timeout=None): # We don't support a timed join here, sorry. assert timeout is None thread = self.__thread if thread is not None: thread.join() # Clear the circular reference. self.__thread = None _thread._remove_thread_id(self.ident)
def __del__(self): # On interpreter shutdown, the _thread module might have # already been cleaned up. if _thread and _thread._remove_thread_id: _thread._remove_thread_id(self.ident)
def __del__(self): if _thread and _thread._remove_thread_id: _thread._remove_thread_id(self.ident)