summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-12-05 11:21:58 +0000
committermidipix <writeonce@midipix.org>2020-12-05 11:45:47 +0000
commit485b7b6e4111769a134af181e6bc169c8e394135 (patch)
tree537688fba88a785a762dd1cc843b7f24330f270c
parentaf34c5590476e66443f4cdfd68f62c7e88c90e5a (diff)
downloadntapi-485b7b6e4111769a134af181e6bc169c8e394135.tar.bz2
ntapi-485b7b6e4111769a134af181e6bc169c8e394135.tar.xz
__ntapi_msq_recv(): obtain atomic lock via loop as needed.
-rw-r--r--src/msq/ntapi_msq_recv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/msq/ntapi_msq_recv.c b/src/msq/ntapi_msq_recv.c
index 4ef1784..6850312 100644
--- a/src/msq/ntapi_msq_recv.c
+++ b/src/msq/ntapi_msq_recv.c
@@ -79,10 +79,10 @@ int32_t __stdcall __ntapi_msq_recv(
/* lock */
hlock = &(__ntapi_internals()->hlock);
- if (at_locked_cas(hlock,0,1))
- return __msq_recv_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}});
/* msg */
__ntapi->tt_aligned_block_memset(