Skip to content

Commit 05322fd

Browse files
committed
8230116: Test workaround to Klass::_class_loader_data sometimes NULL problem
This is a low frequency problem that we are seeing internally, this patch is mostly to rule out one theory. Reviewed-by: dcubed
1 parent 4ab1119 commit 05322fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/hotspot/share/oops/klass.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,12 @@ void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protec
568568
// Restore class_loader_data to the null class loader data
569569
set_class_loader_data(loader_data);
570570

571+
// Workaround for suspected bug. Make sure other threads see this assignment.
572+
// This shouldn't be necessary but the compiler thread seems to be behind
573+
// the times, even though this thread takes MethodCompileQueue_lock and the thread
574+
// that doesn't see this value also takes that lock.
575+
OrderAccess::fence();
576+
571577
// Add to null class loader list first before creating the mirror
572578
// (same order as class file parsing)
573579
loader_data->add_class(this);

0 commit comments

Comments
 (0)