On Wed, 21 Jun 2000, Berend Ozceri wrote:
> Alexandre Julliard wrote:
>
> > The easiest fix is to avoid the add_select_user() at socket creation
> > (by passing -1 as fd to alloc_object), and then have the socket code
> > do an add_select_user() once there is something to wait for, i.e. after
> > we did a connect() or listen() on this socket.
>
> I have something along these lines working, but I've uncovered another problem.
> There seems to be a race between the setting of the socket's WS_FD_CONNECT flag
> in WSOCK32_connect and the calling of sock_poll_event() in wineserver.
Well, there shouldn't be a race, as the WS_FD_CONNECT enable event should
set the state flags such that it *starts* polling; sock_poll_event()
shouldn't be called before the state becomes nonzero. You may want to
change sock_reselect so it doesn't "check whether the condition is
satisfied already" if state == 0, or something (I don't remember whether
it's safe to check for ev == 0 instead).