< prev index next >
src/hotspot/share/gc/shared/concurrentGCThread.cpp
Print this page
rev 51967 : 8221392: Reduce ConcurrentGCThreads spinning during start up
Reviewed-by: eosterlund, kbarrett
*** 1,7 ****
/*
! * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 53,69 ****
this->set_active_handles(JNIHandleBlock::allocate_block());
// From this time Thread::current() should be working.
assert(this == Thread::current(), "just checking");
}
- void ConcurrentGCThread::wait_for_universe_init() {
- MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
- while (!is_init_completed() && !_should_terminate) {
- CGC_lock->wait(Mutex::_no_safepoint_check_flag, 1);
- }
- }
-
void ConcurrentGCThread::terminate() {
assert(_should_terminate, "Should only be called on terminate request.");
// Signal that it is terminated
{
MutexLockerEx mu(Terminator_lock,
--- 53,62 ----
*** 73,83 ****
}
}
void ConcurrentGCThread::run() {
initialize_in_thread();
! wait_for_universe_init();
run_service();
terminate();
}
--- 66,76 ----
}
}
void ConcurrentGCThread::run() {
initialize_in_thread();
! wait_init_completed();
run_service();
terminate();
}
< prev index next >