changeset 14182:3459ee432728

8154436: Drop code to support Windows XP in windows async channel impl Reviewed-by: chegar, alanb
author redestad
date Mon, 18 Apr 2016 14:01:03 +0200
parents fd1140dd7636
children 6c46df4651c9
files src/java.base/windows/classes/sun/nio/ch/Iocp.java src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousServerSocketChannelImpl.java src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java
diffstat 4 files changed, 5 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/windows/classes/sun/nio/ch/Iocp.java	Mon Apr 18 12:36:41 2016 +0200
+++ b/src/java.base/windows/classes/sun/nio/ch/Iocp.java	Mon Apr 18 14:01:03 2016 +0200
@@ -34,8 +34,6 @@
 import java.util.concurrent.*;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.security.AccessController;
-import sun.security.action.GetPropertyAction;
 import jdk.internal.misc.Unsafe;
 
 /**
@@ -46,7 +44,6 @@
 class Iocp extends AsynchronousChannelGroupImpl {
     private static final Unsafe unsafe = Unsafe.getUnsafe();
     private static final long INVALID_HANDLE_VALUE  = -1L;
-    private static final boolean supportsThreadAgnosticIo;
 
     // maps completion key to channel
     private final ReadWriteLock keyToChannelLock = new ReentrantReadWriteLock();
@@ -90,13 +87,6 @@
         <V,A> PendingFuture<V,A> getByOverlapped(long overlapped);
     }
 
-    /**
-     * Indicates if this operating system supports thread agnostic I/O.
-     */
-    static boolean supportsThreadAgnosticIo() {
-        return supportsThreadAgnosticIo;
-    }
-
     // release all resources
     void implClose() {
         synchronized (this) {
@@ -445,11 +435,5 @@
     static {
         IOUtil.load();
         initIDs();
-
-        // thread agnostic I/O on Vista/2008 or newer
-        String osversion = AccessController.doPrivileged(
-            new GetPropertyAction("os.version"));
-        String vers[] = osversion.split("\\.");
-        supportsThreadAgnosticIo = Integer.parseInt(vers[0]) >= 6;
     }
 }
--- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Mon Apr 18 12:36:41 2016 +0200
+++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Mon Apr 18 14:01:03 2016 +0200
@@ -318,20 +318,7 @@
         result.setContext(lockTask);
 
         // initiate I/O
-        if (Iocp.supportsThreadAgnosticIo()) {
-            lockTask.run();
-        } else {
-            boolean executed = false;
-            try {
-                Invoker.invokeOnThreadInThreadPool(this, lockTask);
-                executed = true;
-            } finally {
-                if (!executed) {
-                    // rollback
-                    removeFromFileLockTable(fli);
-                }
-            }
-        }
+        lockTask.run();
         return result;
     }
 
@@ -556,11 +543,7 @@
         result.setContext(readTask);
 
         // initiate I/O
-        if (Iocp.supportsThreadAgnosticIo()) {
-            readTask.run();
-        } else {
-            Invoker.invokeOnThreadInThreadPool(this, readTask);
-        }
+        readTask.run();
         return result;
     }
 
@@ -730,11 +713,7 @@
         result.setContext(writeTask);
 
         // initiate I/O
-        if (Iocp.supportsThreadAgnosticIo()) {
-            writeTask.run();
-        } else {
-            Invoker.invokeOnThreadInThreadPool(this, writeTask);
-        }
+        writeTask.run();
         return result;
     }
 
--- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousServerSocketChannelImpl.java	Mon Apr 18 12:36:41 2016 +0200
+++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousServerSocketChannelImpl.java	Mon Apr 18 14:01:03 2016 +0200
@@ -342,11 +342,7 @@
             throw new AcceptPendingException();
 
         // initiate I/O
-        if (Iocp.supportsThreadAgnosticIo()) {
-            task.run();
-        } else {
-            Invoker.invokeOnThreadInThreadPool(this, task);
-        }
+        task.run();
         return result;
     }
 
--- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java	Mon Apr 18 12:36:41 2016 +0200
+++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java	Mon Apr 18 14:01:03 2016 +0200
@@ -378,11 +378,7 @@
         result.setContext(task);
 
         // initiate I/O
-        if (Iocp.supportsThreadAgnosticIo()) {
-            task.run();
-        } else {
-            Invoker.invokeOnThreadInThreadPool(this, task);
-        }
+        task.run();
         return result;
     }