Skip to content
Browse files
8271215: Fix data races in G1PeriodicGCTask
Reviewed-by: iwalulya, shade
  • Loading branch information
Kim Barrett committed Jul 26, 2021
1 parent 36aefa3 commit f2c359a8826e51a92f6a7c6917f2c3d223c24488
Showing 1 changed file with 4 additions and 0 deletions.
@@ -27,12 +27,16 @@
#include "gc/g1/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1ConcurrentMarkThread.inline.hpp"
#include "gc/g1/g1PeriodicGCTask.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "logging/log.hpp"
#include "runtime/globals.hpp"
#include "runtime/os.hpp"
#include "utilities/globalDefinitions.hpp"

bool G1PeriodicGCTask::should_start_periodic_gc() {
// Ensure no GC safepoints while we're doing the checks, to avoid data races.
SuspendibleThreadSetJoiner sts;

G1CollectedHeap* g1h = G1CollectedHeap::heap();
// If we are currently in a concurrent mark we are going to uncommit memory soon.
if (g1h->concurrent_mark()->cm_thread()->in_progress()) {

1 comment on commit f2c359a

Copy link

@openjdk-notifier openjdk-notifier bot commented on f2c359a Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.