< prev index next >
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Print this page
rev 53944 : Shenandoah GC may initialize thread's gclab twice
*** 480,490 ****
}
class ShenandoahInitGCLABClosure : public ThreadClosure {
public:
void do_thread(Thread* thread) {
! if (thread != NULL && (thread->is_Java_thread() || thread->is_Worker_thread())) {
ShenandoahThreadLocalData::initialize_gclab(thread);
}
}
};
--- 480,492 ----
}
class ShenandoahInitGCLABClosure : public ThreadClosure {
public:
void do_thread(Thread* thread) {
! assert(thread != NULL, "Sanity");
! assert(!thread->is_Java_thread(), "Don't expect JavaThread this early");
! if (thread->is_Worker_thread()) {
ShenandoahThreadLocalData::initialize_gclab(thread);
}
}
};
*** 492,503 ****
CollectedHeap::post_initialize();
MutexLocker ml(Threads_lock);
ShenandoahInitGCLABClosure init_gclabs;
Threads::threads_do(&init_gclabs);
- _workers->threads_do(&init_gclabs);
- _safepoint_workers->threads_do(&init_gclabs);
// gclab can not be initialized early during VM startup, as it can not determinate its max_size.
// Now, we will let WorkGang to initialize gclab when new worker is created.
_workers->set_initialize_gclab();
--- 494,503 ----
< prev index next >