Module: wine Branch: master Commit: dce7a61fa4f90cb8bf6b22a12e3a23e5f8d75ac3 URL: https://gitlab.winehq.org/wine/wine/-/commit/dce7a61fa4f90cb8bf6b22a12e3a23e...
Author: Jinoh Kang jinoh.kang.kr@gmail.com Date: Mon Sep 19 00:34:47 2022 +0900
msvcp90: Use atomic write for releasing threadsafe_queue spin lock.
This fixes data race in ARM/ARM64 platforms, and prevents potential memory access reordering by the compiler.
---
dlls/msvcp90/details.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcp90/details.c b/dlls/msvcp90/details.c index 9b665ee841f..98579dfa991 100644 --- a/dlls/msvcp90/details.c +++ b/dlls/msvcp90/details.c @@ -239,7 +239,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 { @@ -289,7 +289,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);