code: def close(self):
          
          self._lock.acquire()
          try:
              self.closed = True
              while self._waking < len(self._sleeping):
                  wsock, cookie = self._sleeping[self._waking]
                  self._wake(wsock, cookie)
                  self._waking += 1
          finally:
              self._lock.release()
docs: Mark the latch as closed, and cause every sleeping thread to be woken,
          with :class:`mitogen.core.LatchError` raised in each thread.