mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 18:03:44 +00:00
8252794: Creation of JNIMethodBlock should be done with a leaf lock
Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
5fef8ddaff
commit
d56096471b
@ -2185,9 +2185,9 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
||||
ClassLoaderData* cld = loader_data;
|
||||
if (!SafepointSynchronize::is_at_safepoint()) {
|
||||
// Have to add jmethod_ids() to class loader data thread-safely.
|
||||
// Also have to add the method to the list safely, which the cld lock
|
||||
// Also have to add the method to the list safely, which the lock
|
||||
// protects as well.
|
||||
MutexLocker ml(cld->metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
||||
if (cld->jmethod_ids() == NULL) {
|
||||
cld->set_jmethod_ids(new JNIMethodBlock(capacity));
|
||||
} else {
|
||||
@ -2209,9 +2209,9 @@ jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
|
||||
|
||||
if (!SafepointSynchronize::is_at_safepoint()) {
|
||||
// Have to add jmethod_ids() to class loader data thread-safely.
|
||||
// Also have to add the method to the list safely, which the cld lock
|
||||
// Also have to add the method to the list safely, which the lock
|
||||
// protects as well.
|
||||
MutexLocker ml(cld->metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
||||
if (cld->jmethod_ids() == NULL) {
|
||||
cld->set_jmethod_ids(new JNIMethodBlock());
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ void mutex_init() {
|
||||
Notification_lock = Service_lock;
|
||||
}
|
||||
|
||||
def(JmethodIdCreation_lock , PaddedMutex , leaf, true, _safepoint_check_never); // used for creating jmethodIDs.
|
||||
def(JmethodIdCreation_lock , PaddedMutex , special-2, true, _safepoint_check_never); // used for creating jmethodIDs.
|
||||
|
||||
def(SystemDictionary_lock , PaddedMonitor, leaf, true, _safepoint_check_always);
|
||||
def(ProtectionDomainSet_lock , PaddedMutex , leaf-1, true, _safepoint_check_never);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user