diff options
author | alanb <none@none> | 2013-11-12 17:37:45 +0000 |
---|---|---|
committer | alanb <none@none> | 2013-11-12 17:37:45 +0000 |
commit | d50319b1226fd332e8bce64f0b438c1bf5634bf4 (patch) | |
tree | c3d231e13f7f691dab4e2818692654983cf768e0 /src | |
parent | dbe242e378fd852f28556d217c12d3cd4c884094 (diff) |
8028208: (aio) Assertion in clearPendingIoMap when closing at around time file lock is acquired immediately (win)
Reviewed-by: chegar
Diffstat (limited to 'src')
-rw-r--r-- | src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java index fd3fa538c..d747e0f29 100644 --- a/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java +++ b/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(); } |