< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahHeap.hpp

Print this page
rev 11046 : Implement suspendible workers

@@ -340,17 +340,33 @@
         return "ERROR";
     }
   };
 
 private:
-  ShenandoahSharedFlag _cancelled_gc;
+  enum CancelState {
+    // Normal state. GC has not been cancelled and is open for cancellation.
+    // Worker threads can suspend for safepoint.
+    CANCELLABLE,
+
+    // GC has been cancelled. Worker threads can not suspend for
+    // safepoint but must finish their work as soon as possible.
+    CANCELLED,
+
+    // GC has not been cancelled and must not be cancelled. At least
+    // one worker thread checks for pending safepoint and may suspend
+    // if a safepoint is pending.
+    NOT_CANCELLED
+  };
+
+  ShenandoahSharedEnumFlag<CancelState> _cancelled_gc;
   inline bool try_cancel_gc();
 
 public:
   static address cancelled_gc_addr();
 
   inline bool cancelled_gc() const;
+  inline bool check_cancelled_gc_and_yield(bool sts_active = true);
 
   inline void clear_cancelled_gc();
 
   void cancel_gc(GCCause::Cause cause);
 

@@ -401,11 +417,12 @@
 
   void op_reset();
   void op_mark();
   void op_preclean();
   void op_cleanup();
-  void op_evac();
+  void op_conc_evac();
+  void op_stw_evac();
   void op_updaterefs();
   void op_uncommit(double shrink_before);
 
   // Messages for GC trace event, they have to be immortal for
   // passing around the logging/tracing systems
< prev index next >