mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8222811: Consolidate MutexLockerEx and MutexLocker
Make MutexLocker be MutexLockerEx implementation, remove MutexLockerEx calls. Reviewed-by: dcubed, dholmes, pliden, rehn
This commit is contained in:
parent
88303d1c60
commit
fbafef11c0
127 changed files with 718 additions and 746 deletions
|
@ -449,7 +449,7 @@ void ClassLoaderData::record_dependency(const Klass* k) {
|
|||
|
||||
void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) {
|
||||
{
|
||||
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
Klass* old_value = _klasses;
|
||||
k->set_next_link(old_value);
|
||||
// Link the new item into the list, making sure the linked class is stable
|
||||
|
@ -549,7 +549,7 @@ ModuleEntryTable* ClassLoaderData::modules() {
|
|||
modules = new ModuleEntryTable(ModuleEntryTable::_moduletable_entry_size);
|
||||
|
||||
{
|
||||
MutexLockerEx m1(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker m1(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
// Ensure _modules is stable, since it is examined without a lock
|
||||
OrderAccess::release_store(&_modules, modules);
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ ClassLoaderMetaspace* ClassLoaderData::metaspace_non_null() {
|
|||
// Lock-free access requires load_acquire.
|
||||
ClassLoaderMetaspace* metaspace = OrderAccess::load_acquire(&_metaspace);
|
||||
if (metaspace == NULL) {
|
||||
MutexLockerEx ml(_metaspace_lock, Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(_metaspace_lock, Mutex::_no_safepoint_check_flag);
|
||||
// Check if _metaspace got allocated while we were waiting for this lock.
|
||||
if ((metaspace = _metaspace) == NULL) {
|
||||
if (this == the_null_class_loader_data()) {
|
||||
|
@ -764,7 +764,7 @@ ClassLoaderMetaspace* ClassLoaderData::metaspace_non_null() {
|
|||
}
|
||||
|
||||
OopHandle ClassLoaderData::add_handle(Handle h) {
|
||||
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
record_modified_oops();
|
||||
return OopHandle(_handles.add(h()));
|
||||
}
|
||||
|
@ -779,7 +779,7 @@ void ClassLoaderData::remove_handle(OopHandle h) {
|
|||
}
|
||||
|
||||
void ClassLoaderData::init_handle_locked(OopHandle& dest, Handle h) {
|
||||
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
if (dest.resolve() != NULL) {
|
||||
return;
|
||||
} else {
|
||||
|
@ -792,7 +792,7 @@ void ClassLoaderData::init_handle_locked(OopHandle& dest, Handle h) {
|
|||
void ClassLoaderData::add_to_deallocate_list(Metadata* m) {
|
||||
// Metadata in shared region isn't deleted.
|
||||
if (!m->is_shared()) {
|
||||
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
MutexLocker ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
if (_deallocate_list == NULL) {
|
||||
_deallocate_list = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(100, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue