summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-12-05 11:31:26 +0000
committermidipix <writeonce@midipix.org>2020-12-05 11:45:47 +0000
commitbdb1eae13eefe4cb7d9a990b0280c80fca2bf9dd (patch)
treee8dad1ffa527b548403d13b2be94b3477308101d /src
parentebbce46c00867c2a8d5f28ea44b52b432ab5abde (diff)
downloadntapi-bdb1eae13eefe4cb7d9a990b0280c80fca2bf9dd.tar.bz2
ntapi-bdb1eae13eefe4cb7d9a990b0280c80fca2bf9dd.tar.xz
__ntapi_msq_send(): obtain atomic lock via loop as needed.
Diffstat (limited to 'src')
-rw-r--r--src/msq/ntapi_msq_send.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/msq/ntapi_msq_send.c b/src/msq/ntapi_msq_send.c
index f6ca27f..0f7b631 100644
--- a/src/msq/ntapi_msq_send.c
+++ b/src/msq/ntapi_msq_send.c
@@ -77,10 +77,10 @@ int32_t __stdcall __ntapi_msq_send(
/* lock */
hlock = &(__ntapi_internals()->hlock);
- if (at_locked_cas(hlock,0,1))
- return __msq_send_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}});
/* msq data to section */
__ntapi->tt_generic_memcpy(