8223306: Remove threads linked list (use ThreadsList's array in SA)

Reviewed-by: coleenp, dholmes, dcubed
This commit is contained in:
Robbin Ehn 2019-05-21 10:34:57 +02:00
parent a165ef39c6
commit 1645161cad
21 changed files with 133 additions and 117 deletions

View file

@ -1613,7 +1613,6 @@ void JavaThread::initialize() {
set_deopt_compiled_method(NULL);
clear_must_deopt_id();
set_monitor_chunks(NULL);
set_next(NULL);
_on_thread_list = false;
set_thread_state(_thread_new);
_terminated = _not_terminated;
@ -3457,7 +3456,6 @@ void CodeCacheSweeperThread::nmethods_do(CodeBlobClosure* cf) {
// would like. We are actively migrating Threads_lock uses to other
// mechanisms in order to reduce Threads_lock contention.
JavaThread* Threads::_thread_list = NULL;
int Threads::_number_of_threads = 0;
int Threads::_number_of_non_daemon_threads = 0;
int Threads::_return_code = 0;
@ -3764,7 +3762,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
}
// Initialize Threads state
_thread_list = NULL;
_number_of_threads = 0;
_number_of_non_daemon_threads = 0;
@ -4423,9 +4420,6 @@ void Threads::add(JavaThread* p, bool force_daemon) {
BarrierSet::barrier_set()->on_thread_attach(p);
p->set_next(_thread_list);
_thread_list = p;
// Once a JavaThread is added to the Threads list, smr_delete() has
// to be used to delete it. Otherwise we can just delete it directly.
p->set_on_thread_list();
@ -4463,20 +4457,6 @@ void Threads::remove(JavaThread* p, bool is_daemon) {
// Maintain fast thread list
ThreadsSMRSupport::remove_thread(p);
JavaThread* current = _thread_list;
JavaThread* prev = NULL;
while (current != p) {
prev = current;
current = current->next();
}
if (prev) {
prev->set_next(current->next());
} else {
_thread_list = p->next();
}
_number_of_threads--;
if (!is_daemon) {
_number_of_non_daemon_threads--;