Module: wine
Branch: master
Commit: be0701540788d0c5a9b9297bec1b6a45953a722f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=be0701540788d0c5a9b9297b…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Tue Aug 31 19:23:48 2021 -0500
server: Do not call async_terminate() when restarting an already terminated async.
At best this is a no-op. At worst this will emit an extra APC_ASYNC_IO where
the termination (e.g. cancellation) should already have emitted one.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
server/async.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/server/async.c b/server/async.c
index b290005f9a0..086e5eb2870 100644
--- a/server/async.c
+++ b/server/async.c
@@ -387,13 +387,11 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
if (status == STATUS_PENDING) /* restart it */
{
- status = async->status;
- async->status = STATUS_PENDING;
-
- if (status != STATUS_ALERTED) /* it was terminated in the meantime */
- async_terminate( async, status );
- else
+ if (async->status == STATUS_ALERTED)
+ {
+ async->status = STATUS_PENDING;
async_reselect( async );
+ }
}
else
{