This fixes data race in ARM/ARM64 platforms, and prevents potential memory access reordering by the compiler.
From: Jinoh Kang jinoh.kang.kr@gmail.com
This fixes data race in ARM/ARM64 platforms, and prevents potential memory access reordering by the compiler. --- dlls/concrt140/details.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/concrt140/details.c b/dlls/concrt140/details.c index e6711db6983..fb9e2a700eb 100644 --- a/dlls/concrt140/details.c +++ b/dlls/concrt140/details.c @@ -225,7 +225,7 @@ static void threadsafe_queue_push(threadsafe_queue *queue, size_t id, queue->tail = p; if(!queue->head) queue->head = p; - queue->lock = 0; + WriteRelease(&queue->lock, 0); } else { @@ -275,7 +275,7 @@ static BOOL threadsafe_queue_pop(threadsafe_queue *queue, size_t id, queue->head = p->_Next; if(!queue->head) queue->tail = NULL; - queue->lock = 0; + WriteRelease(&queue->lock, 0);
/* TODO: Add exception handling */ call__Concurrent_queue_base_v4__Deallocate_page(parent, p);