changeset 17344:9c8e5c5a8694

8172465: Better handling of channel groups Reviewed-by: alanb, coffeys, skoivu, rhalade, chegar
author bpb
date Mon, 13 Feb 2017 15:24:42 -0800
parents 30442b2e50ec
children 9c3ab6f9da7f
files src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java	Mon Feb 13 16:32:23 2017 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java	Mon Feb 13 15:24:42 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -246,13 +246,16 @@
     abstract void shutdownHandlerTasks();
 
     private void shutdownExecutors() {
-        AccessController.doPrivileged(new PrivilegedAction<>() {
-            public Void run() {
-                pool.executor().shutdown();
-                timeoutExecutor.shutdown();
-                return null;
-            }
-        });
+        AccessController.doPrivileged(
+            new PrivilegedAction<>() {
+                public Void run() {
+                    pool.executor().shutdown();
+                    timeoutExecutor.shutdown();
+                    return null;
+                }
+            },
+            null,
+            new RuntimePermission("modifyThread"));
     }
 
     @Override