summaryrefslogtreecommitdiffhomepage
path: root/src/sem
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-12-05 11:43:09 +0000
committermidipix <writeonce@midipix.org>2020-12-05 11:45:47 +0000
commit37da58077db42d7f6c66e53b9ba0dfbe437c7e8a (patch)
tree9503001a1779d16144b9ad75d99c3f882f7c856f /src/sem
parentca05bb3ec82978849dc1facd3291efb160a61d83 (diff)
downloadntapi-37da58077db42d7f6c66e53b9ba0dfbe437c7e8a.tar.bz2
ntapi-37da58077db42d7f6c66e53b9ba0dfbe437c7e8a.tar.xz
__ntapi_sem_set(): obtain atomic lock via loop as needed.
Diffstat (limited to 'src/sem')
-rw-r--r--src/sem/ntapi_sem_set.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sem/ntapi_sem_set.c b/src/sem/ntapi_sem_set.c
index ab42032..c7833fc 100644
--- a/src/sem/ntapi_sem_set.c
+++ b/src/sem/ntapi_sem_set.c
@@ -92,10 +92,10 @@ int32_t __stdcall __ntapi_sem_set(
/* lock */
hlock = &(__ntapi_internals()->hlock);
- if (at_locked_cas(hlock,0,1))
- return __sem_set_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}});
/* data copy */
__ntapi->tt_generic_memcpy(