changeset 8787:0c414ac10700

8028208: (aio) Assertion in clearPendingIoMap when closing at around time file lock is acquired immediately (win) Reviewed-by: chegar
author alanb
date Tue, 12 Nov 2013 17:37:45 +0000
parents d9f827e4d20c
children 69432cb5bca2
files src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java test/ProblemList.txt
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Tue Nov 12 18:12:47 2013 +0100
+++ b/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Tue Nov 12 17:37:45 2013 +0000
@@ -228,6 +228,7 @@
         @Override
         public void run() {
             long overlapped = 0L;
+            boolean pending = false;
             try {
                 begin();
 
@@ -241,6 +242,7 @@
                                      overlapped);
                     if (n == IOStatus.UNAVAILABLE) {
                         // I/O is pending
+                        pending = true;
                         return;
                     }
                     // acquired lock immediately
@@ -250,10 +252,10 @@
             } 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();
             }
 
--- a/test/ProblemList.txt	Tue Nov 12 18:12:47 2013 +0100
+++ b/test/ProblemList.txt	Tue Nov 12 17:37:45 2013 +0000
@@ -204,9 +204,6 @@
 # 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