[RFC PATCH v2 02/11] server: Add a helper function to trigger synchronous completion of I/O via APC_ASYNC_IO.

Zebediah Figura (she/her) zfigura at codeweavers.com
Tue Jan 25 12:19:45 CST 2022


On 1/22/22 08:36, Jinoh Kang wrote:
> diff --git a/server/async.c b/server/async.c
> index aa6d50cde75..5d0857f3eec 100644
> --- a/server/async.c
> +++ b/server/async.c
> @@ -383,6 +383,23 @@ obj_handle_t async_handoff( struct async *async, data_size_t *result, int force_
>       return async->wait_handle;
>   }
>   
> +/* Set up synchronous completion of I/O via the APC_ASYNC_IO system APC.
> + * This function is intended to be called immediately before async_handoff(),
> + * and expects the last error status to be STATUS_ALERTED.
> + *
> + * The information argument can be used to pass extra information to the client
> + * (e.g. whether the socket is in non-blocking mode).
> + */
> +void async_start_sync_io_request( struct async *async, data_size_t information )
> +{
> +    assert( get_error() == STATUS_ALERTED );
> +    assert( async->thread == current );
> +    assert( !async->pending );
> +
> +    async->direct_result = 0;  /* force APC to fire off */
> +    async->iosb->result = information;
> +}
> +
>   /* complete a request-based async with a pre-allocated buffer */
>   void async_request_complete( struct async *async, unsigned int status, data_size_t result,
>                                data_size_t out_size, void *out_data )

Please add helpers only in the patches where they're used; it makes 
things very difficult to review otherwise.



More information about the wine-devel mailing list