[PATCH 5/5] server: Don't wake up always-blocking asyncs.
Zebediah Figura
zfigura at codeweavers.com
Fri Sep 3 23:11:42 CDT 2021
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 12 ++++++------
server/async.c | 4 ++--
server/device.c | 2 +-
server/file.h | 2 +-
server/sock.c | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
index 4f8dd6585a4..de09abb04ba 100644
--- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
@@ -1169,15 +1169,15 @@ static void test_blocking_irp(void)
memset(&io, 0xcc, sizeof(io));
status = NtQueryVolumeInformationFile(file, &io, buffer, sizeof(buffer), FileFsSizeInformation);
- todo_wine ok(!status, "got %#x\n", status);
- todo_wine ok(!io.Status, "got iosb status %#x\n", io.Status);
- todo_wine ok(!io.Information, "got information %#Ix\n", io.Information);
+ ok(!status, "got %#x\n", status);
+ ok(!io.Status, "got iosb status %#x\n", io.Status);
+ ok(!io.Information, "got information %#Ix\n", io.Information);
memset(&io, 0xcc, sizeof(io));
status = NtQueryVolumeInformationFile(file, &io, buffer, sizeof(buffer), FileFsFullSizeInformation);
- todo_wine ok(status == STATUS_DEVICE_NOT_READY, "got %#x\n", status);
- todo_wine ok(io.Status == STATUS_DEVICE_NOT_READY, "got iosb status %#x\n", io.Status);
- todo_wine ok(!io.Information, "got information %#Ix\n", io.Information);
+ ok(status == STATUS_DEVICE_NOT_READY, "got %#x\n", status);
+ ok(io.Status == STATUS_DEVICE_NOT_READY, "got iosb status %#x\n", io.Status);
+ ok(!io.Information, "got information %#Ix\n", io.Information);
CloseHandle(file);
}
diff --git a/server/async.c b/server/async.c
index 6aba392fd84..4822b0735c6 100644
--- a/server/async.c
+++ b/server/async.c
@@ -285,13 +285,13 @@ struct async *create_async( struct fd *fd, struct thread *thread, const async_da
return async;
}
-void set_async_pending( struct async *async, int signal )
+void set_async_pending( struct async *async )
{
if (!async->terminated)
{
async->pending = 1;
async->unknown_status = 0;
- if (signal && !async->signaled)
+ if (!async->blocking && !async->signaled)
{
async->signaled = 1;
wake_up( &async->obj, 0 );
diff --git a/server/device.c b/server/device.c
index 9515d238fb4..a2383ecdc7c 100644
--- a/server/device.c
+++ b/server/device.c
@@ -961,7 +961,7 @@ DECL_HANDLER(get_next_device_request)
* so we need to do it now */
cancel_irp_call( irp );
else if (irp->async)
- set_async_pending( irp->async, irp->file && is_fd_overlapped( irp->file->fd ) );
+ set_async_pending( irp->async );
free_irp_params( irp );
release_object( irp );
diff --git a/server/file.h b/server/file.h
index 22879b75c05..80f2191c050 100644
--- a/server/file.h
+++ b/server/file.h
@@ -229,7 +229,7 @@ extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned
extern void async_set_result( struct object *obj, unsigned int status, apc_param_t total );
extern void async_set_completion_callback( struct async *async, async_completion_callback func, void *private );
extern void async_set_unknown_status( struct async *async );
-extern void set_async_pending( struct async *async, int signal );
+extern void set_async_pending( struct async *async );
extern int async_waiting( struct async_queue *queue );
extern void async_terminate( struct async *async, unsigned int status );
extern void async_request_complete( struct async *async, unsigned int status, data_size_t result,
diff --git a/server/sock.c b/server/sock.c
index bfaf6329ff4..d61ed5b95b2 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -2399,7 +2399,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
obj_handle_t event_handle;
int mask;
- set_async_pending( async, 0 );
+ set_async_pending( async );
if (is_machine_64bit( current->process->machine ))
{
@@ -2530,7 +2530,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
#endif
}
- set_async_pending( async, 0 );
+ set_async_pending( async );
if (bind( unix_fd, &bind_addr.addr, unix_len ) < 0)
{
--
2.33.0
More information about the wine-devel
mailing list