--- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-05-27 13:03:41.900244738 +0200 +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-05-27 13:03:41.760246135 +0200 @@ -900,7 +900,7 @@ G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1CollectorPolicy* g1p = g1h->g1_policy(); - _has_aborted = false; + clear_has_aborted(); #ifndef PRODUCT if (G1PrintReachableAtInitialMark) { @@ -3260,7 +3260,7 @@ } _first_overflow_barrier_sync.abort(); _second_overflow_barrier_sync.abort(); - _has_aborted = true; + set_has_aborted(); SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); satb_mq_set.abandon_partial_marking(); --- old/src/share/vm/gc_implementation/g1/concurrentMark.hpp 2014-05-27 13:03:42.711185882 +0200 +++ new/src/share/vm/gc_implementation/g1/concurrentMark.hpp 2014-05-27 13:03:42.571196677 +0200 @@ -822,7 +822,9 @@ // Called to abort the marking cycle after a Full GC takes place. void abort(); - bool has_aborted() { return _has_aborted; } + bool has_aborted() { return _has_aborted; } + void set_has_aborted() { _has_aborted = true; } + void clear_has_aborted() { _has_aborted = false; } // This prints the global/local fingers. It is used for debugging. NOT_PRODUCT(void print_finger();) --- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-05-27 13:03:43.481190005 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-05-27 13:03:43.330068260 +0200 @@ -2173,10 +2173,11 @@ } void G1CollectedHeap::stop() { - // Abort any ongoing concurrent root region scanning and stop all - // concurrent threads. We do this to make sure these threads do - // not continue to execute and access resources (e.g. gclog_or_tty) - // that are destroyed during shutdown. + // Abort any ongoing concurrent mark and stop all concurrent threads. + // We do this to make sure these threads do not continue to execute + // and access resources (e.g. gclog_or_tty) that are destroyed during + // shutdown. + _cm->set_has_aborted(); _cm->root_regions()->abort(); _cm->root_regions()->wait_until_scan_finished(); stop_conc_gc_threads();