mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8201556: Disallow reading oops in ClassLoaderData if unloading
Move class_loader oop to an OopHandle, and assert that holder is alive when getting class_loader. Reviewed-by: kbarrett, adinn
This commit is contained in:
parent
702ac597ad
commit
ddfd4c33c6
22 changed files with 121 additions and 47 deletions
|
@ -51,8 +51,8 @@ template <WeakHandleType T>
|
|||
void WeakHandle<T>::release() const {
|
||||
// Only release if the pointer to the object has been created.
|
||||
if (_obj != NULL) {
|
||||
// Clear the WeakHandle. For class loader data race, the handle may not have
|
||||
// been previously cleared by GC.
|
||||
// Clear the WeakHandle. For race in creating ClassLoaderData, we can release this
|
||||
// WeakHandle before it is cleared by GC.
|
||||
RootAccess<ON_PHANTOM_OOP_REF>::oop_store(_obj, (oop)NULL);
|
||||
get_storage()->release(_obj);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue