diff --git a/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java b/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java index 8723f0aac6913afcb5b792505ed8098b1b7afd19..2444d09ec23b1c3af4bfa127aa40a4479c3733c7 100644 --- a/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java +++ b/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java @@ -73,6 +73,11 @@ public class ForkJoinWorkerThread extends Thread { final ForkJoinPool pool; // the pool this thread works in 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. * @@ -82,6 +87,7 @@ public class ForkJoinWorkerThread extends Thread { protected ForkJoinWorkerThread(ForkJoinPool pool) { // Use a placeholder until a useful name can be set in registerWorker super("aForkJoinWorkerThread"); + U.putOrderedObject(this, INHERITEDACCESSCONTROLCONTEXT, INNOCUOUS_ACC); this.pool = pool; this.workQueue = pool.registerWorker(this); } @@ -215,13 +221,6 @@ public class ForkJoinWorkerThread extends Thread { private static final ThreadGroup innocuousThreadGroup = createThreadGroup(); - /** An AccessControlContext supporting no privileges */ - private static final AccessControlContext INNOCUOUS_ACC = - new AccessControlContext( - new ProtectionDomain[] { - new ProtectionDomain(null, null) - }); - InnocuousForkJoinWorkerThread(ForkJoinPool pool) { super(pool, innocuousThreadGroup, INNOCUOUS_ACC); }