< prev index next >
src/share/vm/classfile/moduleEntry.cpp
Print this page
*** 78,98 ****
version->increment_refcount();
}
}
// Returns the shared ProtectionDomain
! Handle ModuleEntry::shared_protection_domain() {
! return Handle(Thread::current(), JNIHandles::resolve(_pd));
}
// Set the shared ProtectionDomain atomically
void ModuleEntry::set_shared_protection_domain(ClassLoaderData *loader_data,
Handle pd_h) {
// Create a handle for the shared ProtectionDomain and save it atomically.
// If someone beats us setting the _pd cache, the created handle is destroyed.
! jobject obj = loader_data->add_handle(pd_h);
! if (Atomic::cmpxchg_ptr(obj, &_pd, NULL) != NULL) {
loader_data->remove_handle_unsafe(obj);
}
}
// Returns true if this module can read module m
--- 78,98 ----
version->increment_refcount();
}
}
// Returns the shared ProtectionDomain
! oop ModuleEntry::shared_protection_domain() {
! return _pd.resolve_acquire();
}
// Set the shared ProtectionDomain atomically
void ModuleEntry::set_shared_protection_domain(ClassLoaderData *loader_data,
Handle pd_h) {
// Create a handle for the shared ProtectionDomain and save it atomically.
// If someone beats us setting the _pd cache, the created handle is destroyed.
! OopHandle obj = loader_data->add_handle(pd_h);
! if (!_pd.set_atomic(obj)) {
loader_data->remove_handle_unsafe(obj);
}
}
// Returns true if this module can read module m
< prev index next >