Paolo Bonzini wrote:
> I agree, but it seems like pipe WaitForSingleObject is broken.  You'd
> need a thread polling with PeekNamedPipe, or a busy-waiting loop in the
> main thread altogether.

Maybe we need to reset the pipe from "signaled" to "non-signaled" state
after [Msg]WaitFor..Objects returns, using ResetState()?

Or otherwise, a nearly busy-waiting loop like this:

rpl_select (...)
{
  ...preparations up to line 346...
  for (;;)
    {
      ... code from line 348..418...
      if ((timeout && ret == WAIT_TIMEOUT) || rc != 0)
        break;
      /* MsgWaitForMultipleObjects returned because some handle is in signaled
         state, but the handle is not actually ready for I/O.  */
      Sleep (5);
    }
  if (!timeout && rc == 0)
    abort ();
  return rc;
}

Bruno



Reply via email to