Print this page
rev 2518 : [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 ↓ 3095 lines elided ↑ open up ↑
3859 3860    // even in sequential code.
3860 3861    SharedHeap* sh = SharedHeap::heap();
3861 3862    bool is_par = (sh->n_par_threads() > 0);
3862 3863    int cp = SharedHeap::heap()->strong_roots_parity();
3863 3864    ALL_JAVA_THREADS(p) {
3864 3865      if (p->claim_oops_do(is_par, cp)) {
3865 3866        p->oops_do(f, cf);
3866 3867      }
3867 3868    }
3868 3869    VMThread* vmt = VMThread::vm_thread();
3869      -  if (vmt->claim_oops_do(is_par, cp))
     3870 +  if (vmt->claim_oops_do(is_par, cp)) {
3870 3871      vmt->oops_do(f, cf);
     3872 +  }
3871 3873  }
3872 3874  
3873 3875  #ifndef SERIALGC
3874 3876  // Used by ParallelScavenge
3875 3877  void Threads::create_thread_roots_tasks(GCTaskQueue* q) {
3876 3878    ALL_JAVA_THREADS(p) {
3877 3879      q->enqueue(new ThreadRootsTask(p));
3878 3880    }
3879 3881    q->enqueue(new ThreadRootsTask(VMThread::vm_thread()));
3880 3882  }
↓ open down ↓ 469 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX