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

@ -65,7 +65,7 @@ void LoaderConstraintTable::free_entry(LoaderConstraintEntry *entry) {
LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
Symbol* name, Handle loader) {
assert_lock_strong(SystemDictionary_lock);
unsigned int hash = compute_hash(name);
int index = hash_to_index(hash);
LoaderConstraintEntry** pp = bucket_addr(index);
@ -89,7 +89,7 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
void LoaderConstraintTable::purge_loader_constraints() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(SystemDictionary_lock);
LogTarget(Info, class, loader, constraints) lt;
// Remove unloaded entries from constraint table
for (int index = 0; index < table_size(); index++) {