mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8256167: Convert JDK use of Reference::get
to Reference::refersTo
Reviewed-by: sspitsyn, shade, dfuchs, alanb, kbarrett
This commit is contained in:
parent
78be334c38
commit
972bc3b408
12 changed files with 49 additions and 53 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -402,9 +402,8 @@ class DirectMethodHandle extends MethodHandle {
|
|||
if (ref == null) {
|
||||
return true; // the final state
|
||||
}
|
||||
Thread clinitThread = ref.get();
|
||||
// Somebody may still be running defc.<clinit>.
|
||||
if (clinitThread == Thread.currentThread()) {
|
||||
if (ref.refersTo(Thread.currentThread())) {
|
||||
// If anybody is running defc.<clinit>, it is this thread.
|
||||
if (UNSAFE.shouldBeInitialized(defc))
|
||||
// Yes, we are running it; keep the barrier for now.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue