Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
2020:a5610f0862fe | 2021:7cf1a74771e8 |
---|---|
307 #endif | 307 #endif |
308 | 308 |
309 // Build a methodDataOop object to hold information about this method | 309 // Build a methodDataOop object to hold information about this method |
310 // collected in the interpreter. | 310 // collected in the interpreter. |
311 void methodOopDesc::build_interpreter_method_data(methodHandle method, TRAPS) { | 311 void methodOopDesc::build_interpreter_method_data(methodHandle method, TRAPS) { |
312 // Do not profile method if current thread holds the pending list lock, | |
313 // which avoids deadlock for acquiring the MethodData_lock. | |
314 if (instanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) { | |
315 return; | |
316 } | |
317 | |
312 // Grab a lock here to prevent multiple | 318 // Grab a lock here to prevent multiple |
313 // methodDataOops from being created. | 319 // methodDataOops from being created. |
314 MutexLocker ml(MethodData_lock, THREAD); | 320 MutexLocker ml(MethodData_lock, THREAD); |
315 if (method->method_data() == NULL) { | 321 if (method->method_data() == NULL) { |
316 methodDataOop method_data = oopFactory::new_methodData(method, CHECK); | 322 methodDataOop method_data = oopFactory::new_methodData(method, CHECK); |