summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-08-19 23:50:32 -0700
committerJan Kotas <jkotas@microsoft.com>2015-08-20 20:27:55 -0700
commitf31a36b395cf8139489b5c94e47c542abee2240f (patch)
tree14ffcefcb285ac0fa8c55f9e19c83f8601eccbcf /src/debug
parent06e030df6b1bd453447578ad5f9eb3619feb4e4c (diff)
downloadcoreclr-f31a36b395cf8139489b5c94e47c542abee2240f.tar.gz
coreclr-f31a36b395cf8139489b5c94e47c542abee2240f.tar.bz2
coreclr-f31a36b395cf8139489b5c94e47c542abee2240f.zip
Use volatile stores for values read by DAC
VS2015 optimizer is smart enough to optimize out stores into globals that are only read by the DAC.
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/ee/debugger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp
index ce72f276e8..330a4b316f 100644
--- a/src/debug/ee/debugger.cpp
+++ b/src/debug/ee/debugger.cpp
@@ -2195,7 +2195,8 @@ HRESULT Debugger::StartupPhase2(Thread * pThread)
// After returning from debugger startup we assume that the runtime might start using the NGEN flags to make
// binding decisions. From now on the debugger can not influence NGEN binding policy
- s_fCanChangeNgenFlags = FALSE;
+ // Use volatile store to guarantee make the value visible to the DAC (the store can be optimized out otherwise)
+ VolatileStoreWithoutBarrier(&s_fCanChangeNgenFlags, FALSE);
// Must release the lock (which would be done at the end of this method anyways) so that
// the helper thread can do the jit-attach.