< prev index next >

src/hotspot/share/gc/z/zRelocate.cpp

Print this page
@@ -21,10 +21,11 @@
   * questions.
   */
  
  #include "precompiled.hpp"
  #include "gc/shared/gc_globals.hpp"
+ #include "gc/shared/suspendibleThreadSet.hpp"
  #include "gc/z/zAbort.inline.hpp"
  #include "gc/z/zAddress.inline.hpp"
  #include "gc/z/zBarrier.inline.hpp"
  #include "gc/z/zForwarding.inline.hpp"
  #include "gc/z/zHeap.inline.hpp"

@@ -330,10 +331,14 @@
        // completed).
        _target = _forwarding->claim_page();
        _target->reset_for_in_place_relocation();
        _forwarding->set_in_place();
      }
+ 
+     if (SuspendibleThreadSet::should_yield()) {
+       SuspendibleThreadSet::yield();
+     }
    }
  
  public:
    ZRelocateClosure(Allocator* allocator) :
        _allocator(allocator),

@@ -401,10 +406,11 @@
  
    virtual void work() {
      ZRelocateClosure<ZRelocateSmallAllocator> small(&_small_allocator);
      ZRelocateClosure<ZRelocateMediumAllocator> medium(&_medium_allocator);
  
+     SuspendibleThreadSetJoiner sts_joiner;
      for (ZForwarding* forwarding; _iter.next(&forwarding);) {
        if (is_small(forwarding)) {
          small.do_forwarding(forwarding);
        } else {
          medium.do_forwarding(forwarding);
< prev index next >