8214522: Last runtime locking issues for concurrent class unloading

Reviewed-by: coleenp, pliden
This commit is contained in:
Erik Österlund 2018-12-05 08:55:42 +01:00
parent 9c22151345
commit cb1aebae6e
4 changed files with 2 additions and 3 deletions

View File

@ -583,7 +583,6 @@ void ClassLoaderDataGraph::clean_module_and_package_info() {
}
void ClassLoaderDataGraph::purge() {
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
ClassLoaderData* list = _unloading;
_unloading = NULL;
ClassLoaderData* next = list;

View File

@ -235,7 +235,7 @@ void Dictionary::clean_cached_protection_domains(DictionaryEntry* probe) {
void Dictionary::do_unloading() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(SystemDictionary_lock);
// The NULL class loader doesn't initiate loading classes from other class loaders
if (loader_data() == ClassLoaderData::the_null_class_loader_data()) {

View File

@ -865,6 +865,7 @@ void MetaspaceUtils::verify_metrics() {
// Utils to check if a pointer or range is part of a committed metaspace region.
metaspace::VirtualSpaceNode* MetaspaceUtils::find_enclosing_virtual_space(const void* p) {
MutexLockerEx cl(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
VirtualSpaceNode* vsn = Metaspace::space_list()->find_enclosing_space(p);
if (Metaspace::using_class_space() && vsn == NULL) {
vsn = Metaspace::class_space_list()->find_enclosing_space(p);

View File

@ -89,7 +89,6 @@ void VirtualSpaceList::dec_virtual_space_count() {
// nodes with a 0 container_count. Remove Metachunks in
// the node from their respective freelists.
void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
assert(SafepointSynchronize::is_at_safepoint(), "must be called at safepoint for contains to work");
assert_lock_strong(MetaspaceExpand_lock);
// Don't use a VirtualSpaceListIterator because this
// list is being changed and a straightforward use of an iterator is not safe.