8198269: Allow GCCauseSetter to be used outside of safepoints
authorpliden
Mon, 19 Feb 2018 15:44:56 +0100
changeset 49019 68b283918441
parent 49018 f7caa2aecc86
child 49020 6d61be5959e0
8198269: Allow GCCauseSetter to be used outside of safepoints Reviewed-by: stefank, sjohanss
src/hotspot/share/gc/shared/collectedHeap.hpp
--- 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);
   }
 };