mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8300098: java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java fails with internal timeout when executed with TieredCompilation1/3
Co-authored-by: Doug Lea <dl@openjdk.org> Reviewed-by: jpai, alanb
This commit is contained in:
parent
7ae447f4eb
commit
ecf8842cd2
1 changed files with 10 additions and 10 deletions
|
@ -2862,22 +2862,20 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
|
||||||
* Possibly blocks awaiting root lock.
|
* Possibly blocks awaiting root lock.
|
||||||
*/
|
*/
|
||||||
private final void contendedLock() {
|
private final void contendedLock() {
|
||||||
boolean waiting = false;
|
Thread current = Thread.currentThread(), w;
|
||||||
for (int s;;) {
|
for (int s;;) {
|
||||||
if (((s = lockState) & ~WAITER) == 0) {
|
if (((s = lockState) & ~WAITER) == 0) {
|
||||||
if (U.compareAndSetInt(this, LOCKSTATE, s, WRITER)) {
|
if (U.compareAndSetInt(this, LOCKSTATE, s, WRITER)) {
|
||||||
if (waiting)
|
if (waiter == current)
|
||||||
waiter = null;
|
U.compareAndSetReference(this, WAITERTHREAD, current, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((s & WAITER) == 0) {
|
else if ((s & WAITER) == 0)
|
||||||
if (U.compareAndSetInt(this, LOCKSTATE, s, s | WAITER)) {
|
U.compareAndSetInt(this, LOCKSTATE, s, s | WAITER);
|
||||||
waiting = true;
|
else if ((w = waiter) == null)
|
||||||
waiter = Thread.currentThread();
|
U.compareAndSetReference(this, WAITERTHREAD, null, current);
|
||||||
}
|
else if (w == current)
|
||||||
}
|
|
||||||
else if (waiting)
|
|
||||||
LockSupport.park(this);
|
LockSupport.park(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3296,6 +3294,8 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
|
||||||
|
|
||||||
private static final long LOCKSTATE
|
private static final long LOCKSTATE
|
||||||
= U.objectFieldOffset(TreeBin.class, "lockState");
|
= U.objectFieldOffset(TreeBin.class, "lockState");
|
||||||
|
private static final long WAITERTHREAD
|
||||||
|
= U.objectFieldOffset(TreeBin.class, "waiter");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------Table Traversal -------------- */
|
/* ----------------Table Traversal -------------- */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue