--- old/src/share/vm/classfile/classLoaderData.cpp 2016-12-21 08:13:50.567595694 -0500 +++ new/src/share/vm/classfile/classLoaderData.cpp 2016-12-21 08:13:49.512884288 -0500 @@ -205,12 +205,13 @@ } void ClassLoaderData::modules_do(void f(ModuleEntry*)) { - assert_locked_or_safepoint(Module_lock); - if (_modules != NULL) { - for (int i = 0; i < _modules->table_size(); i++) { - for (ModuleEntry* entry = _modules->bucket(i); - entry != NULL; - entry = entry->next()) { + // Lock-free access requires load_ptr_acquire + ModuleEntryTable* modules = load_ptr_acquire(&_modules); + if (modules != NULL) { + for (int i = 0; i < modules->table_size(); i++) { + for (ModuleEntry* entry = modules->bucket(i); + entry != NULL; + entry = entry->next()) { f(entry); } } @@ -223,8 +224,8 @@ if (packages != NULL) { for (int i = 0; i < packages->table_size(); i++) { for (PackageEntry* entry = packages->bucket(i); - entry != NULL; - entry = entry->next()) { + entry != NULL; + entry = entry->next()) { f(entry); } }