Mercurial > hg > graal-compiler
diff src/share/vm/oops/methodOop.cpp @ 2021:7cf1a74771e8
6988439: Parallel Class Loading test deadlock involving MethodData_lock and Pending List Lock
Summary: Don't acquire methodData_lock while holding pending list lock
Reviewed-by: kvn, never, ysr
author | coleenp |
---|---|
date | Fri, 10 Dec 2010 12:13:03 -0500 |
parents | f95d63e2154a |
children | 8012aa3ccede |
line wrap: on
line diff
--- a/src/share/vm/oops/methodOop.cpp Thu Dec 09 20:12:06 2010 -0500 +++ b/src/share/vm/oops/methodOop.cpp Fri Dec 10 12:13:03 2010 -0500 @@ -309,6 +309,12 @@ // 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);