mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8237117: Better ForkJoinPool behavior
Reviewed-by: dfuchs, alanb, rhalade, mullan
This commit is contained in:
parent
fe514a2e55
commit
0ffa6b75fd
1 changed files with 6 additions and 5 deletions
|
@ -78,6 +78,11 @@ public class ForkJoinWorkerThread extends Thread {
|
||||||
final ForkJoinPool pool; // the pool this thread works in
|
final ForkJoinPool pool; // the pool this thread works in
|
||||||
final ForkJoinPool.WorkQueue workQueue; // work-stealing mechanics
|
final ForkJoinPool.WorkQueue workQueue; // work-stealing mechanics
|
||||||
|
|
||||||
|
/** An AccessControlContext supporting no privileges */
|
||||||
|
private static final AccessControlContext INNOCUOUS_ACC =
|
||||||
|
new AccessControlContext(
|
||||||
|
new ProtectionDomain[] { new ProtectionDomain(null, null) });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a ForkJoinWorkerThread operating in the given pool.
|
* Creates a ForkJoinWorkerThread operating in the given pool.
|
||||||
*
|
*
|
||||||
|
@ -99,6 +104,7 @@ public class ForkJoinWorkerThread extends Thread {
|
||||||
ForkJoinWorkerThread(ForkJoinPool pool, ClassLoader ccl) {
|
ForkJoinWorkerThread(ForkJoinPool pool, ClassLoader ccl) {
|
||||||
super("aForkJoinWorkerThread");
|
super("aForkJoinWorkerThread");
|
||||||
super.setContextClassLoader(ccl);
|
super.setContextClassLoader(ccl);
|
||||||
|
ThreadLocalRandom.setInheritedAccessControlContext(this, INNOCUOUS_ACC);
|
||||||
this.pool = pool;
|
this.pool = pool;
|
||||||
this.workQueue = pool.registerWorker(this);
|
this.workQueue = pool.registerWorker(this);
|
||||||
}
|
}
|
||||||
|
@ -214,11 +220,6 @@ public class ForkJoinWorkerThread extends Thread {
|
||||||
group, "InnocuousForkJoinWorkerThreadGroup");
|
group, "InnocuousForkJoinWorkerThreadGroup");
|
||||||
}});
|
}});
|
||||||
|
|
||||||
/** An AccessControlContext supporting no privileges */
|
|
||||||
private static final AccessControlContext INNOCUOUS_ACC =
|
|
||||||
new AccessControlContext(
|
|
||||||
new ProtectionDomain[] { new ProtectionDomain(null, null) });
|
|
||||||
|
|
||||||
InnocuousForkJoinWorkerThread(ForkJoinPool pool) {
|
InnocuousForkJoinWorkerThread(ForkJoinPool pool) {
|
||||||
super(pool,
|
super(pool,
|
||||||
ClassLoader.getSystemClassLoader(),
|
ClassLoader.getSystemClassLoader(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue