On 18/11/2021 11:14, Yann Ylavic wrote:
On Wed, Nov 17, 2021 at 8:10 PM Mladen Turk <mt...@apache.org> wrote:
If only a single thread can call apr_poll_drain_wakeup_pipe
it shoud be OK.
Calling apr_poll{set,cb}_poll() concurrently on the same pollset is
quite undefined behaviour with our implementation(s), so I think we
are OK here.
However I'd rather check if there is
something to read before calling apr_file_getc since it'll block.
I restored nonblocking on unix in my patch already, here is a new one
that does the same on Windows (I still can't compile/test it though,
likewise for the OS/2 bits..).
This new patch does not blindly set nonblocking for the pipe-socket
(like r1894917) but adds a new ->socket boolean to Windows' struct
apr_file_t (similar to the existing ->pipe flag), such that
file_socket_pipe_create() can now create a nonblocking socket (via
create_socket_pipe) for the read side of the pipe and apr_file_read()
can do the right thing (i.e. WSARecv/WSASend) when ->socket is set.
Does it work for you?
Patch looks fine, namely the changes to apr_file_read.
Didn't have time to check it, but will do it over the weekend.
Regards
--
^TM