[PATCH 3/5] server: Use async->iosb->status instead of async->status in async_satisfied().
Zebediah Figura
zfigura at codeweavers.com
Tue Aug 31 19:23:49 CDT 2021
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
I find the "status" field to be quite confusing; it is in particular difficult
to remember what distinguishes async->status from async->iosb->status. Patches
3-5 in this set are an attempt to clarify the code by dividing it up into
separate boolean flags.
server/async.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/server/async.c b/server/async.c
index 086e5eb2870..7890122969f 100644
--- a/server/async.c
+++ b/server/async.c
@@ -112,13 +112,16 @@ static void async_satisfied( struct object *obj, struct wait_queue_entry *entry
struct async *async = (struct async *)obj;
assert( obj->ops == &async_ops );
+ /* we only return an async handle for asyncs created via create_request_async() */
+ assert( async->iosb );
+
if (async->direct_result)
{
async_set_result( &async->obj, async->iosb->status, async->iosb->result );
async->direct_result = 0;
}
- set_wait_status( entry, async->status );
+ set_wait_status( entry, async->iosb->status );
/* close wait handle here to avoid extra server round trip */
if (async->wait_handle)
@@ -398,6 +401,7 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
if (async->timeout) remove_timeout_user( async->timeout );
async->timeout = NULL;
async->status = status;
+ if (async->iosb) async->iosb->status = status;
if (async->data.apc)
{
--
2.33.0
More information about the wine-devel
mailing list