8235678: Remove unnecessary calls to Thread::current() in MutexLocker calls

Add THREAD argument when available and make Thread* the first argument to relevant MutexLocker and MonitorLocker constructors

Reviewed-by: lfoltan, coleenp, dholmes
This commit is contained in:
Harold Seigel 2020-01-16 13:48:23 +00:00
parent e2240b714e
commit 7fc58a1020
36 changed files with 122 additions and 121 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, 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
@ -2580,7 +2580,7 @@ void JvmtiExport::post_sampled_object_alloc(JavaThread *thread, oop object) {
void JvmtiExport::cleanup_thread(JavaThread* thread) {
assert(JavaThread::current() == thread, "thread is not current");
MutexLocker mu(JvmtiThreadState_lock);
MutexLocker mu(thread, JvmtiThreadState_lock);
if (thread->jvmti_thread_state() != NULL) {
// This has to happen after the thread state is removed, which is