Zebediah Figura : server: Use a separate field to track whether the async has been alerted.
Alexandre Julliard
julliard at winehq.org
Wed Sep 1 15:45:09 CDT 2021
Module: wine
Branch: master
Commit: da838c2ae53396be6ba415e3868e1667ff2bbc66
URL: https://source.winehq.org/git/wine.git/?a=commit;h=da838c2ae53396be6ba415e3868e1667ff2bbc66
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Tue Aug 31 19:23:50 2021 -0500
server: Use a separate field to track whether the async has been alerted.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/async.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/async.c b/server/async.c
index 7890122969f..47225af11c9 100644
--- a/server/async.c
+++ b/server/async.c
@@ -52,6 +52,7 @@ struct async
unsigned int signaled :1;
unsigned int pending :1; /* request successfully queued, but pending */
unsigned int direct_result :1;/* a flag if we're passing result directly from request instead of APC */
+ unsigned int alerted :1; /* fd is signaled, but we are waiting for client-side I/O */
struct completion *completion; /* completion associated with fd */
apc_param_t comp_key; /* completion key associated with fd */
unsigned int comp_flags; /* completion flags */
@@ -161,6 +162,8 @@ void async_terminate( struct async *async, unsigned int status )
async->status = status;
if (async->iosb && async->iosb->status == STATUS_PENDING) async->iosb->status = status;
+ if (status == STATUS_ALERTED)
+ async->alerted = 1;
/* if no APC could be queued (e.g. the process is terminated),
* thread_queue_apc() may trigger async_set_result(), which may drop the
@@ -246,6 +249,7 @@ struct async *create_async( struct fd *fd, struct thread *thread, const async_da
async->pending = 1;
async->wait_handle = 0;
async->direct_result = 0;
+ async->alerted = 0;
async->completion = fd_get_completion( fd, &async->comp_key );
async->comp_flags = 0;
async->completion_callback = NULL;
@@ -390,9 +394,10 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
if (status == STATUS_PENDING) /* restart it */
{
- if (async->status == STATUS_ALERTED)
+ if (async->alerted)
{
async->status = STATUS_PENDING;
+ async->alerted = 0;
async_reselect( async );
}
}
More information about the wine-cvs
mailing list