docs: def _doSelectInThread(self, timeout):
          """Run one iteration of the I/O monitor loop.
  
          This will run all selectables who had input or output readiness
          waiting for them.
          """
          reads = self.reads
          writes = self.writes
          while 1:
              try:
                  r, w, ignored = _select(reads.keys(),
                                          writes.keys(),
                                          [], timeout)
                  break
              except ValueError, ve:
                  # Possibly a file descriptor has gone negative?
                  log.err()
                  self._preenDescriptorsInThread()
              except TypeError, te:
                  # Something *totally* invalid (object w/o fileno, non-integral
                  # result) was passed
                  log.err()
                  self._preenDescriptorsInThread()
              except (select.error, IOError), se:
                  # select(2) encountered an error
                  if se.args[0] in (0, 2):
                      # windows does this if it got an empty list
                      if (not reads) and (not writes):
                          return
                      else:
                          raise
                  elif se.args[0] == EINTR:
                      return
                  elif se.args[0] == EBADF:
                      self._preenDescriptorsInThread()
                  else:
                      # OK, I really don't know what's going on.  Blow up.
                      raise
          self._sendToMain('Notify', r, w)