8154436: Drop code to support Windows XP in windows async channel impl
Reviewed-by: chegar, alanb
This commit is contained in:
parent
6ace4f6b74
commit
630e47238e
@ -34,8 +34,6 @@ import java.util.*;
|
||||
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 @@ import jdk.internal.misc.Unsafe;
|
||||
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 @@ class Iocp extends AsynchronousChannelGroupImpl {
|
||||
<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 @@ class Iocp extends AsynchronousChannelGroupImpl {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -318,20 +318,7 @@ public class WindowsAsynchronousFileChannelImpl
|
||||
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 @@ public class WindowsAsynchronousFileChannelImpl
|
||||
result.setContext(readTask);
|
||||
|
||||
// initiate I/O
|
||||
if (Iocp.supportsThreadAgnosticIo()) {
|
||||
readTask.run();
|
||||
} else {
|
||||
Invoker.invokeOnThreadInThreadPool(this, readTask);
|
||||
}
|
||||
readTask.run();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -730,11 +713,7 @@ public class WindowsAsynchronousFileChannelImpl
|
||||
result.setContext(writeTask);
|
||||
|
||||
// initiate I/O
|
||||
if (Iocp.supportsThreadAgnosticIo()) {
|
||||
writeTask.run();
|
||||
} else {
|
||||
Invoker.invokeOnThreadInThreadPool(this, writeTask);
|
||||
}
|
||||
writeTask.run();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -342,11 +342,7 @@ class WindowsAsynchronousServerSocketChannelImpl
|
||||
throw new AcceptPendingException();
|
||||
|
||||
// initiate I/O
|
||||
if (Iocp.supportsThreadAgnosticIo()) {
|
||||
task.run();
|
||||
} else {
|
||||
Invoker.invokeOnThreadInThreadPool(this, task);
|
||||
}
|
||||
task.run();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -378,11 +378,7 @@ class WindowsAsynchronousSocketChannelImpl
|
||||
result.setContext(task);
|
||||
|
||||
// initiate I/O
|
||||
if (Iocp.supportsThreadAgnosticIo()) {
|
||||
task.run();
|
||||
} else {
|
||||
Invoker.invokeOnThreadInThreadPool(this, task);
|
||||
}
|
||||
task.run();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user