From 373b6ba30990b3d063b864d60f56efce926cbe27 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 5 Dec 2020 11:35:29 +0000 Subject: __ntapi_sem_ioctl(): obtain atomic lock via loop as needed. --- src/sem/ntapi_sem_ioctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sem') diff --git a/src/sem/ntapi_sem_ioctl.c b/src/sem/ntapi_sem_ioctl.c index 63f0eec..ddac294 100644 --- a/src/sem/ntapi_sem_ioctl.c +++ b/src/sem/ntapi_sem_ioctl.c @@ -90,10 +90,10 @@ int32_t __stdcall __ntapi_sem_ioctl( /* lock */ hlock = &(__ntapi_internals()->hlock); - if (at_locked_cas(hlock,0,1)) - return __sem_ioctl_return( - mapaddr,0, - NT_STATUS_RESOURCE_NOT_OWNED); + while (at_locked_cas(hlock,0,1)) + __ntapi->zw_delay_execution( + NT_SYNC_NON_ALERTABLE, + &(nt_timeout){{0,0}}); /* semop array to section */ __ntapi->tt_generic_memcpy( -- cgit v1.2.3