8207778: Add locking to ModuleEntry and PackageEntry tables

Restructure ClassLoaderDataGraph code to simplify using locks in SystemDictionary::do_unloading()

Reviewed-by: lfoltan, coleenp
This commit is contained in:
Harold Seigel 2018-08-10 09:30:26 -04:00
parent 092e9e4f81
commit 83b2fb5b0d
7 changed files with 37 additions and 28 deletions

View file

@ -436,7 +436,7 @@ ModuleEntry* ModuleEntryTable::lookup_only(Symbol* name) {
// Remove dead modules from all other alive modules' reads list.
// This should only occur at class unloading.
void ModuleEntryTable::purge_all_module_reads() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(Module_lock);
for (int i = 0; i < table_size(); i++) {
for (ModuleEntry* entry = bucket(i);
entry != NULL;