code: def Stop(self):
      
      self._shutdown = True
      self._new_updates.set()  # Wake up the transmission thread.
  
      if self._main_thread is not None:
        self._main_thread.join()
        self._main_thread = None
  
      if self._transmission_thread is not None:
        self._transmission_thread.join()
        self._transmission_thread = None
docs: Signals the worker threads to shut down and waits until it exits.