From f5d34bdef1e34f8a601868948816b7905476bd93 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 12 Nov 2013 17:37:45 +0000 Subject: [PATCH] 8028208: (aio) Assertion in clearPendingIoMap when closing at around time file lock is acquired immediately (win) Reviewed-by: chegar --- .../sun/nio/ch/WindowsAsynchronousFileChannelImpl.java | 6 ++++-- jdk/test/ProblemList.txt | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java index fd3fa538c13..d747e0f2938 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java @@ -228,6 +228,7 @@ public class WindowsAsynchronousFileChannelImpl @Override public void run() { long overlapped = 0L; + boolean pending = false; try { begin(); @@ -241,6 +242,7 @@ public class WindowsAsynchronousFileChannelImpl overlapped); if (n == IOStatus.UNAVAILABLE) { // I/O is pending + pending = true; return; } // acquired lock immediately @@ -250,10 +252,10 @@ public class WindowsAsynchronousFileChannelImpl } catch (Throwable x) { // lock failed or channel closed removeFromFileLockTable(fli); - if (overlapped != 0L) - ioCache.remove(overlapped); result.setFailure(toIOException(x)); } finally { + if (!pending && overlapped != 0L) + ioCache.remove(overlapped); end(); } diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 94f730fb200..317ee36d35d 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -204,9 +204,6 @@ java/net/DatagramSocket/SendDatagramToBadAddress.java macosx-all # 6963118 java/nio/channels/Selector/Wakeup.java windows-all -# 7052549 -java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java windows-all - # 7133499, 7133497 java/nio/channels/AsyncCloseAndInterrupt.java macosx-all java/nio/channels/AsynchronousFileChannel/Lock.java macosx-all