Skip to content

Commit

Permalink
the other part of suspension fix (#42721)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maoni0 authored Sep 25, 2020
1 parent 8930303 commit 0426f16
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/coreclr/src/vm/threadsuspend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6256,6 +6256,16 @@ void ThreadSuspend::SuspendEE(SUSPEND_REASON reason)
g_SuspendStatistics.EndSuspend(reason == SUSPEND_FOR_GC || reason == SUSPEND_FOR_GC_PREP);
#endif //TIME_SUSPEND
ThreadSuspend::s_fSuspended = true;

#if defined(TARGET_ARM) || defined(TARGET_ARM64)
// Flush the store buffers on all CPUs, to ensure that all changes made so far are seen
// by the GC threads. This only matters on weak memory ordered processors as
// the strong memory ordered processors wouldn't have reordered the relevant writes.
// This is needed to synchronize threads that were running in preemptive mode thus were
// left alone by suspension to flush their writes that they made before they switched to
// preemptive mode.
::FlushProcessWriteBuffers();
#endif //TARGET_ARM || TARGET_ARM64
}

#if defined(FEATURE_HIJACK) && defined(TARGET_UNIX)
Expand Down

0 comments on commit 0426f16

Please sign in to comment.