summaryrefslogtreecommitdiff
path: root/packaging/0001-Fix-a-PAL-spin-lock-issue.patch
blob: 4064c912ba3d072476f457d267ba266e7e79d405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From e4d6f871c0c6a2327c16520c2d8146db5c715c17 Mon Sep 17 00:00:00 2001
From: Koundinya Veluri <kouvel@microsoft.com>
Date: Wed, 22 Aug 2018 10:55:49 -0700
Subject: [PATCH] Fix a PAL spin lock issue

Fixes https://github.com/dotnet/coreclr/issues/18486
- Lock release needs to be at least volatile
---
 src/pal/src/synchobj/mutex.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pal/src/synchobj/mutex.cpp b/src/pal/src/synchobj/mutex.cpp
index d5f4edd110c7..cf329e6101d0 100644
--- a/src/pal/src/synchobj/mutex.cpp
+++ b/src/pal/src/synchobj/mutex.cpp
@@ -804,7 +804,7 @@ void SPINLOCKAcquire (LONG * lock, unsigned int flags)
 
 void SPINLOCKRelease (LONG * lock)
 {
-    *lock = 0;
+    VolatileStore(lock, 0);
 }
 
 DWORD SPINLOCKTryAcquire (LONG * lock)