mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8255124: KeepAliveStreamCleaner may crash with java.lang.IllegalMonitorStateException: current thread is not owner
Reviewed-by: alanb, chegar, dfuchs
This commit is contained in:
parent
299e1154af
commit
211bb62a90
2 changed files with 12 additions and 2 deletions
|
@ -30,6 +30,7 @@ import java.util.LinkedList;
|
|||
import sun.net.NetProperties;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
|
@ -115,7 +116,7 @@ class KeepAliveStreamCleaner
|
|||
long before = System.currentTimeMillis();
|
||||
long timeout = TIMEOUT;
|
||||
while ((kace = poll()) == null) {
|
||||
waiter.wait(timeout);
|
||||
waiter.await(timeout, TimeUnit.MILLISECONDS);
|
||||
|
||||
long after = System.currentTimeMillis();
|
||||
long elapsed = after - before;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue