mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8158854: Ensure release_store is paired with load_acquire in lock-free code
Reviewed-by: shade, dcubed, zgu
This commit is contained in:
parent
56ff858c45
commit
6db26ca5bf
10 changed files with 87 additions and 23 deletions
|
@ -67,12 +67,12 @@ static void* volatile _verify_byte_codes_fn = NULL;
|
|||
static volatile jint _is_new_verify_byte_codes_fn = (jint) true;
|
||||
|
||||
static void* verify_byte_codes_fn() {
|
||||
if (_verify_byte_codes_fn == NULL) {
|
||||
if (OrderAccess::load_ptr_acquire(&_verify_byte_codes_fn) == NULL) {
|
||||
void *lib_handle = os::native_java_library();
|
||||
void *func = os::dll_lookup(lib_handle, "VerifyClassCodesForMajorVersion");
|
||||
OrderAccess::release_store_ptr(&_verify_byte_codes_fn, func);
|
||||
if (func == NULL) {
|
||||
OrderAccess::release_store(&_is_new_verify_byte_codes_fn, false);
|
||||
_is_new_verify_byte_codes_fn = false;
|
||||
func = os::dll_lookup(lib_handle, "VerifyClassCodes");
|
||||
OrderAccess::release_store_ptr(&_verify_byte_codes_fn, func);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue