summaryrefslogtreecommitdiffhomepage
path: root/src/sem
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-12-05 11:35:29 +0000
committermidipix <writeonce@midipix.org>2020-12-05 11:45:47 +0000
commit373b6ba30990b3d063b864d60f56efce926cbe27 (patch)
tree7dc465cc784d9029d7cc9187ce061342c61472d2 /src/sem
parent396c7f03bfa9b598ceede71aa673e0b353333cec (diff)
downloadntapi-373b6ba30990b3d063b864d60f56efce926cbe27.tar.bz2
ntapi-373b6ba30990b3d063b864d60f56efce926cbe27.tar.xz
__ntapi_sem_ioctl(): obtain atomic lock via loop as needed.
Diffstat (limited to 'src/sem')
-rw-r--r--src/sem/ntapi_sem_ioctl.c8
1 files changed, 4 insertions, 4 deletions
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(