summaryrefslogtreecommitdiffhomepage
path: root/src/ipc
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-12-03 21:46:53 +0000
committermidipix <writeonce@midipix.org>2020-12-04 13:24:15 +0000
commit4e839802f1d4c0c329ff0059bf5df0b0f3efed74 (patch)
treebab8a77baf14a16108afe12cf8d7c21789d31020 /src/ipc
parentda8524f795dd4db68540b80d3c7e5a10132da79f (diff)
downloadntapi-4e839802f1d4c0c329ff0059bf5df0b0f3efed74.tar.bz2
ntapi-4e839802f1d4c0c329ff0059bf5df0b0f3efed74.tar.xz
__ntapi_ipc_init_section_by_port(): obtain atomic lock via loop as needed.
Diffstat (limited to 'src/ipc')
-rw-r--r--src/ipc/ntapi_ipc_connect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ipc/ntapi_ipc_connect.c b/src/ipc/ntapi_ipc_connect.c
index 8f0d8e1..8a00ca0 100644
--- a/src/ipc/ntapi_ipc_connect.c
+++ b/src/ipc/ntapi_ipc_connect.c
@@ -659,8 +659,10 @@ int32_t __stdcall __ntapi_ipc_init_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(