8166364: fatal error: acquiring lock DirtyCardQ_CBL_mon/16 out of order with lock Module_lock/6 -- possible deadlock

Set the mirror's module field outside of the module lock.

Reviewed-by: dsamersoff, dholmes, rehn
This commit is contained in:
Harold Seigel 2016-10-10 08:34:32 -04:00
parent b7b3fb4266
commit 63e0cc39e9
3 changed files with 25 additions and 16 deletions

View file

@ -244,6 +244,12 @@ static void define_javabase_module(jobject module, jstring version,
"Module java.base is already defined");
}
// Only the thread that actually defined the base module will get here,
// so no locking is needed.
// Patch any previously loaded class's module field with java.base's java.lang.reflect.Module.
ModuleEntryTable::patch_javabase_entries(module_handle);
log_debug(modules)("define_javabase_module(): Definition of module: java.base,"
" version: %s, location: %s, package #: %d",
module_version != NULL ? module_version : "NULL",