code: def stop(self, timeout=None):
          
          self._lock.acquire()
          try:
              if self._thread:
                  self._queue.put_nowait(self._terminator)
                  self._thread.join(timeout=timeout)
                  self._thread = None
          finally:
              self._lock.release()
docs: Stops the task thread. Synchronous!