code: def join(self, timeout=3600):
          
          start = time.time()
          while self._running:
              now = time.time()
              maxtime = timeout + start - now
              if maxtime <= 0:
                  return
              QCoreApplication.processEvents(
                  QEventLoop.AllEvents, int(maxtime * 1000))
docs: Wait until the event loop terminates or ``timeout`` is
          reached.
  
          This method is not meaningful unless called from the Qt "main
          thread", which is almost certainly the thread in which the
          component was created.
  
          :keyword float timeout: timeout in seconds.