diff options
author | midipix <writeonce@midipix.org> | 2020-12-05 11:40:17 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2020-12-05 11:45:47 +0000 |
commit | 97b89a73a8d5b541d8e5cd7a7a276a07c75877ed (patch) | |
tree | 9c2a2b35036318787a12ee8940623d99ca0950a1 | |
parent | a6e4e724775eb19eb22673e68d48c6d88b0b6fbb (diff) | |
download | ntapi-97b89a73a8d5b541d8e5cd7a7a276a07c75877ed.tar.bz2 ntapi-97b89a73a8d5b541d8e5cd7a7a276a07c75877ed.tar.xz |
__ntapi_sem_query(): obtain atomic lock via loop as needed.
-rw-r--r-- | src/sem/ntapi_sem_query.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sem/ntapi_sem_query.c b/src/sem/ntapi_sem_query.c index 5f1ff6a..35d3384 100644 --- a/src/sem/ntapi_sem_query.c +++ b/src/sem/ntapi_sem_query.c @@ -85,10 +85,10 @@ int32_t __stdcall __ntapi_sem_query( /* lock */ hlock = &(__ntapi_internals()->hlock); - if (at_locked_cas(hlock,0,1)) - return __sem_query_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 */ |