code: def stop(self):
          
          with self.condition:
              self.running = False
              self.condition.notify_all()
docs: Force the next() method to return while in another thread.
          The return value of next() will be None.