Print this page
rev 2691 : [mq]: g1-reference-processing

Split Close
Expand all
Collapse all
          --- old/src/share/vm/runtime/thread.cpp
          +++ new/src/share/vm/runtime/thread.cpp
↓ open down ↓ 741 lines elided ↑ open up ↑
 742  742    // returns the value of the field osthread()->interrupted().
 743  743    return os::is_interrupted(thread, clear_interrupted);
 744  744  }
 745  745  
 746  746  
 747  747  // GC Support
 748  748  bool Thread::claim_oops_do_par_case(int strong_roots_parity) {
 749  749    jint thread_parity = _oops_do_parity;
 750  750    if (thread_parity != strong_roots_parity) {
 751  751      jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity);
 752      -    if (res == thread_parity) return true;
 753      -    else {
      752 +    if (res == thread_parity) {
      753 +      return true;
      754 +    } else {
 754  755        guarantee(res == strong_roots_parity, "Or else what?");
 755  756        assert(SharedHeap::heap()->n_par_threads() > 0,
 756  757               "Should only fail when parallel.");
 757  758        return false;
 758  759      }
 759  760    }
 760  761    assert(SharedHeap::heap()->n_par_threads() > 0,
 761  762           "Should only fail when parallel.");
 762  763    return false;
 763  764  }
↓ open down ↓ 3134 lines elided ↑ open up ↑
3898 3899    // even in sequential code.
3899 3900    SharedHeap* sh = SharedHeap::heap();
3900 3901    bool is_par = (sh->n_par_threads() > 0);
3901 3902    int cp = SharedHeap::heap()->strong_roots_parity();
3902 3903    ALL_JAVA_THREADS(p) {
3903 3904      if (p->claim_oops_do(is_par, cp)) {
3904 3905        p->oops_do(f, cf);
3905 3906      }
3906 3907    }
3907 3908    VMThread* vmt = VMThread::vm_thread();
3908      -  if (vmt->claim_oops_do(is_par, cp))
     3909 +  if (vmt->claim_oops_do(is_par, cp)) {
3909 3910      vmt->oops_do(f, cf);
     3911 +  }
3910 3912  }
3911 3913  
3912 3914  #ifndef SERIALGC
3913 3915  // Used by ParallelScavenge
3914 3916  void Threads::create_thread_roots_tasks(GCTaskQueue* q) {
3915 3917    ALL_JAVA_THREADS(p) {
3916 3918      q->enqueue(new ThreadRootsTask(p));
3917 3919    }
3918 3920    q->enqueue(new ThreadRootsTask(VMThread::vm_thread()));
3919 3921  }
↓ open down ↓ 469 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX