code: def stop(self):
          
          self._stop_event.set()
          os.write(self._pipe[1], b'stop')
          threading.Thread.join(self)
          Notifier.stop(self)
          self._pollobj.unregister(self._pipe[0])
          os.close(self._pipe[0])
          os.close(self._pipe[1])
docs: Stop notifier's loop. Stop notification. Join the thread.