751 // GC Support |
751 // GC Support |
752 bool Thread::claim_oops_do_par_case(int strong_roots_parity) { |
752 bool Thread::claim_oops_do_par_case(int strong_roots_parity) { |
753 jint thread_parity = _oops_do_parity; |
753 jint thread_parity = _oops_do_parity; |
754 if (thread_parity != strong_roots_parity) { |
754 if (thread_parity != strong_roots_parity) { |
755 jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity); |
755 jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity); |
756 if (res == thread_parity) return true; |
756 if (res == thread_parity) { |
757 else { |
757 return true; |
|
758 } else { |
758 guarantee(res == strong_roots_parity, "Or else what?"); |
759 guarantee(res == strong_roots_parity, "Or else what?"); |
759 assert(SharedHeap::heap()->n_par_threads() > 0, |
760 assert(SharedHeap::heap()->n_par_threads() > 0, |
760 "Should only fail when parallel."); |
761 "Should only fail when parallel."); |
761 return false; |
762 return false; |
762 } |
763 } |
3907 if (p->claim_oops_do(is_par, cp)) { |
3908 if (p->claim_oops_do(is_par, cp)) { |
3908 p->oops_do(f, cf); |
3909 p->oops_do(f, cf); |
3909 } |
3910 } |
3910 } |
3911 } |
3911 VMThread* vmt = VMThread::vm_thread(); |
3912 VMThread* vmt = VMThread::vm_thread(); |
3912 if (vmt->claim_oops_do(is_par, cp)) |
3913 if (vmt->claim_oops_do(is_par, cp)) { |
3913 vmt->oops_do(f, cf); |
3914 vmt->oops_do(f, cf); |
|
3915 } |
3914 } |
3916 } |
3915 |
3917 |
3916 #ifndef SERIALGC |
3918 #ifndef SERIALGC |
3917 // Used by ParallelScavenge |
3919 // Used by ParallelScavenge |
3918 void Threads::create_thread_roots_tasks(GCTaskQueue* q) { |
3920 void Threads::create_thread_roots_tasks(GCTaskQueue* q) { |