src/share/vm/runtime/thread.cpp

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

*** 747,758 **** // GC Support bool Thread::claim_oops_do_par_case(int strong_roots_parity) { jint thread_parity = _oops_do_parity; if (thread_parity != strong_roots_parity) { jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity); ! if (res == thread_parity) return true; ! else { guarantee(res == strong_roots_parity, "Or else what?"); assert(SharedHeap::heap()->n_par_threads() > 0, "Should only fail when parallel."); return false; } --- 747,759 ---- // GC Support bool Thread::claim_oops_do_par_case(int strong_roots_parity) { jint thread_parity = _oops_do_parity; if (thread_parity != strong_roots_parity) { jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity); ! if (res == thread_parity) { ! return true; ! } else { guarantee(res == strong_roots_parity, "Or else what?"); assert(SharedHeap::heap()->n_par_threads() > 0, "Should only fail when parallel."); return false; }
*** 3866,3877 **** if (p->claim_oops_do(is_par, cp)) { p->oops_do(f, cf); } } VMThread* vmt = VMThread::vm_thread(); ! if (vmt->claim_oops_do(is_par, cp)) vmt->oops_do(f, cf); } #ifndef SERIALGC // Used by ParallelScavenge void Threads::create_thread_roots_tasks(GCTaskQueue* q) { --- 3867,3879 ---- if (p->claim_oops_do(is_par, cp)) { p->oops_do(f, cf); } } VMThread* vmt = VMThread::vm_thread(); ! if (vmt->claim_oops_do(is_par, cp)) { vmt->oops_do(f, cf); + } } #ifndef SERIALGC // Used by ParallelScavenge void Threads::create_thread_roots_tasks(GCTaskQueue* q) {