< prev index next >
src/share/vm/classfile/classLoaderData.cpp
Print this page
*** 203,216 ****
assert(k != k->next_link(), "no loops!");
}
}
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()) {
f(entry);
}
}
--- 203,217 ----
assert(k != k->next_link(), "no loops!");
}
}
void ClassLoaderData::modules_do(void f(ModuleEntry*)) {
! // 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);
}
}
< prev index next >