mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
6988439: Parallel Class Loading test deadlock involving MethodData_lock and Pending List Lock
Don't acquire methodData_lock while holding pending list lock Reviewed-by: kvn, never, ysr
This commit is contained in:
parent
83c72a434a
commit
aa521ed9cd
3 changed files with 12 additions and 0 deletions
|
@ -309,6 +309,12 @@ void methodOopDesc::print_invocation_count() {
|
|||
// Build a methodDataOop object to hold information about this method
|
||||
// collected in the interpreter.
|
||||
void methodOopDesc::build_interpreter_method_data(methodHandle method, TRAPS) {
|
||||
// Do not profile method if current thread holds the pending list lock,
|
||||
// which avoids deadlock for acquiring the MethodData_lock.
|
||||
if (instanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Grab a lock here to prevent multiple
|
||||
// methodDataOops from being created.
|
||||
MutexLocker ml(MethodData_lock, THREAD);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue