< prev index next >
src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java
Print this page
*** 74,84 ****
{
super(provider);
this.pool = pool;
if (pool.isFixedThreadPool()) {
! taskQueue = new ConcurrentLinkedQueue<Runnable>();
} else {
taskQueue = null; // not used
}
// use default thread factory as thread should not be visible to
--- 74,84 ----
{
super(provider);
this.pool = pool;
if (pool.isFixedThreadPool()) {
! taskQueue = new ConcurrentLinkedQueue<>();
} else {
taskQueue = null; // not used
}
// use default thread factory as thread should not be visible to
*** 113,123 ****
}
};
}
private void startInternalThread(final Runnable task) {
! AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
// internal threads should not be visible to application so
// cannot use user-supplied thread factory
ThreadPool.defaultThreadFactory().newThread(task).start();
--- 113,123 ----
}
};
}
private void startInternalThread(final Runnable task) {
! AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public Void run() {
// internal threads should not be visible to application so
// cannot use user-supplied thread factory
ThreadPool.defaultThreadFactory().newThread(task).start();
*** 244,254 ****
* Shutdown all tasks waiting for I/O events.
*/
abstract void shutdownHandlerTasks();
private void shutdownExecutors() {
! AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
pool.executor().shutdown();
timeoutExecutor.shutdown();
return null;
}
--- 244,254 ----
* Shutdown all tasks waiting for I/O events.
*/
abstract void shutdownHandlerTasks();
private void shutdownExecutors() {
! AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
pool.executor().shutdown();
timeoutExecutor.shutdown();
return null;
}
*** 321,331 ****
final AccessControlContext acc = AccessController.getContext();
final Runnable delegate = task;
task = new Runnable() {
@Override
public void run() {
! AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
delegate.run();
return null;
}
--- 321,331 ----
final AccessControlContext acc = AccessController.getContext();
final Runnable delegate = task;
task = new Runnable() {
@Override
public void run() {
! AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public Void run() {
delegate.run();
return null;
}
< prev index next >