code: def start_if_necessary(self):
          
          self.lock.acquire()
          try:
              if not self.listening:
                  self.init()
  
                  self.listening = True
                  self.listening_thread = Thread(target=self.listen)
                  self.listening_thread.daemon = True
                  self.listening_thread.start()
  
                  self.processing_thread = Thread(target=self.process)
                  self.processing_thread.daemon = True
                  self.processing_thread.start()
          finally:
              self.lock.release()
docs: Starts the listening thread if it wans't already.