8361952: Installation of MethodData::extra_data_lock() misses synchronization on reader side

Reviewed-by: chagedorn
Backport-of: 272e66d017a3497d9af4df6f042c741ad8a59dd6
This commit is contained in:
Tobias Hartmann 2025-07-16 06:33:47 +00:00
parent 0e6bf00550
commit 60196a6b6f

View File

@ -1860,7 +1860,7 @@ public:
};
Mutex* MethodData::extra_data_lock() {
Mutex* lock = Atomic::load(&_extra_data_lock);
Mutex* lock = Atomic::load_acquire(&_extra_data_lock);
if (lock == nullptr) {
// This lock could be acquired while we are holding DumpTimeTable_lock/nosafepoint
lock = new Mutex(Mutex::nosafepoint-1, "MDOExtraData_lock");