From f5ce7cc12424908c8872cbd5b9a0df80fa96a4d5 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 3 Dec 2020 21:52:42 +0000 Subject: __ntapi_ipc_disconnect_unmap_section_by_port(): obtain lock via loop as needed. --- src/ipc/ntapi_ipc_connect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ipc') diff --git a/src/ipc/ntapi_ipc_connect.c b/src/ipc/ntapi_ipc_connect.c index 8a00ca0..16f725e 100644 --- a/src/ipc/ntapi_ipc_connect.c +++ b/src/ipc/ntapi_ipc_connect.c @@ -734,8 +734,10 @@ int32_t __stdcall __ntapi_ipc_disconnect_unmap_section_by_port( __internals = __ntapi_internals(); /* lock */ - if (at_locked_cas(&__internals->hlock,0,1)) - return NT_STATUS_RESOURCE_NOT_OWNED; + while (at_locked_cas(&__internals->hlock,0,1)) + __ntapi->zw_delay_execution( + NT_SYNC_NON_ALERTABLE, + &(nt_timeout){{0,0}}); /* connection node */ if ((status = dalist_get_node_by_key( -- cgit v1.2.3