mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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.
|
||||
*/
|
||||
private final void contendedLock() {
|
||||
boolean waiting = false;
|
||||
Thread current = Thread.currentThread(), w;
|
||||
for (int s;;) {
|
||||
if (((s = lockState) & ~WAITER) == 0) {
|
||||
if (U.compareAndSetInt(this, LOCKSTATE, s, WRITER)) {
|
||||
if (waiting)
|
||||
waiter = null;
|
||||
if (waiter == current)
|
||||
U.compareAndSetReference(this, WAITERTHREAD, current, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if ((s & WAITER) == 0) {
|
||||
if (U.compareAndSetInt(this, LOCKSTATE, s, s | WAITER)) {
|
||||
waiting = true;
|
||||
waiter = Thread.currentThread();
|
||||
}
|
||||
}
|
||||
else if (waiting)
|
||||
else if ((s & WAITER) == 0)
|
||||
U.compareAndSetInt(this, LOCKSTATE, s, s | WAITER);
|
||||
else if ((w = waiter) == null)
|
||||
U.compareAndSetReference(this, WAITERTHREAD, null, current);
|
||||
else if (w == current)
|
||||
LockSupport.park(this);
|
||||
}
|
||||
}
|
||||
|
@ -3296,6 +3294,8 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
|
|||
|
||||
private static final long LOCKSTATE
|
||||
= U.objectFieldOffset(TreeBin.class, "lockState");
|
||||
private static final long WAITERTHREAD
|
||||
= U.objectFieldOffset(TreeBin.class, "waiter");
|
||||
}
|
||||
|
||||
/* ----------------Table Traversal -------------- */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue