8198269: Allow GCCauseSetter to be used outside of safepoints
Reviewed-by: stefank, sjohanss
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp Mon Feb 19 15:07:21 2018 +0100
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Mon Feb 19 15:44:56 2018 +0100
@@ -622,16 +622,12 @@
GCCause::Cause _previous_cause;
public:
GCCauseSetter(CollectedHeap* heap, GCCause::Cause cause) {
- assert(SafepointSynchronize::is_at_safepoint(),
- "This method manipulates heap state without locking");
_heap = heap;
_previous_cause = _heap->gc_cause();
_heap->set_gc_cause(cause);
}
~GCCauseSetter() {
- assert(SafepointSynchronize::is_at_safepoint(),
- "This method manipulates heap state without locking");
_heap->set_gc_cause(_previous_cause);
}
};