server: Allow calling async_handoff() with status code STATUS_ALERTED.
commit15483b1a126902a8c7b7b59800a376bc473e2ed3
authorJinoh Kang <jinoh.kang.kr@gmail.com>
Wed, 9 Feb 2022 16:17:53 +0000 (10 01:17 +0900)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 10 Feb 2022 19:18:38 +0000 (10 20:18 +0100)
treef5d4ff229cf448b49810ecdd982cf0a4f6a449e2
parent6ed3af99b5526e32361f958f48e11fbee401f30e
server: Allow calling async_handoff() with status code STATUS_ALERTED.

If the server detects that an I/O request could be completed immediately
(e.g. the socket to read from already has incoming data), it can now
return STATUS_ALERTED to allow opportunistic synchronous I/O.  The Unix
side will then attempt to perform I/O in nonblocking mode and report
back the I/O status to the server via the new server request
"set_async_direct_result".  If the operation returns e.g. EAGAIN
or EWOULDBLOCK, the client can opt to either abandon the request (by
specifying an error status) or poll for it in the server as usual (by
waiting on the wait handle).

Without such mechanism in place, the client cannot safely perform
immediately satiable I/O operations synchronously, since it can
potentially conflict with other pending I/O operations that have already
been queued.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
include/wine/server_protocol.h
server/async.c
server/protocol.def
server/request.h
server/trace.c