mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 10:03:38 +00:00
concrt140: 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.
This commit is contained in:
parent
d1e23696df
commit
94512ecc12
|
@ -225,7 +225,7 @@ static void threadsafe_queue_push(threadsafe_queue *queue, size_t id,
|
||||||
queue->tail = p;
|
queue->tail = p;
|
||||||
if(!queue->head)
|
if(!queue->head)
|
||||||
queue->head = p;
|
queue->head = p;
|
||||||
queue->lock = 0;
|
WriteRelease(&queue->lock, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -275,7 +275,7 @@ static BOOL threadsafe_queue_pop(threadsafe_queue *queue, size_t id,
|
||||||
queue->head = p->_Next;
|
queue->head = p->_Next;
|
||||||
if(!queue->head)
|
if(!queue->head)
|
||||||
queue->tail = NULL;
|
queue->tail = NULL;
|
||||||
queue->lock = 0;
|
WriteRelease(&queue->lock, 0);
|
||||||
|
|
||||||
/* TODO: Add exception handling */
|
/* TODO: Add exception handling */
|
||||||
call__Concurrent_queue_base_v4__Deallocate_page(parent, p);
|
call__Concurrent_queue_base_v4__Deallocate_page(parent, p);
|
||||||
|
|
Loading…
Reference in a new issue