From f7f262bb19b6a80916d672a2b53958deed8424c4 Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Thu, 9 Mar 2017 14:40:21 -0800 Subject: [PATCH] Fix some cross-thread memory accesses in a JIT test. This test was concurrently accessing shared memory without using appropriate volatile accesses. This change adds the `volatile.` prefix where necessary. There is a slim change that this will fix dotnet/coreclr#10022. Commit migrated from https://github.com/dotnet/coreclr/commit/84d5151162a5f50ec06d14a9b3e7c98eea809c19 --- src/coreclr/tests/src/JIT/Methodical/Boxing/misc/concurgc.il | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/coreclr/tests/src/JIT/Methodical/Boxing/misc/concurgc.il b/src/coreclr/tests/src/JIT/Methodical/Boxing/misc/concurgc.il index ad0abb1..a497b97 100644 --- a/src/coreclr/tests/src/JIT/Methodical/Boxing/misc/concurgc.il +++ b/src/coreclr/tests/src/JIT/Methodical/Boxing/misc/concurgc.il @@ -27,6 +27,7 @@ IL_0002: call void [mscorlib]System.GC::Collect() ldc.i4 100 call void [mscorlib]System.Threading.Thread::Sleep(int32) + volatile. ldsfld bool Test.App::signal brfalse.s IL_0002 ret @@ -54,6 +55,7 @@ IL_0014: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) IL_0019: stloc.2 ldc.i4.0 + volatile. stsfld bool Test.App::signal IL_001a: ldloc.2 IL_001b: call instance void [mscorlib]System.Threading.Thread::Start() @@ -137,6 +139,7 @@ IL_00bf: blt IL_0041 IL_00c1: ldc.i4.1 + volatile. IL_00c2: stsfld bool Test.App::signal IL_00c7: ldstr "**** PASSED ****" IL_00cc: call void [System.Console]System.Console::WriteLine(class System.String) -- 2.7.4