Mercurial > hg > icedtea7-forest > jdk
changeset 9176:82dac06ce388
8171388: Update JNDI Thread contexts
Reviewed-by: chegar
author | robm |
---|---|
date | Fri, 16 Dec 2016 20:39:07 +0000 |
parents | 797914a333ca |
children | f32656a789b8 |
files | src/share/classes/java/lang/Thread.java |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/java/lang/Thread.java Mon Dec 26 16:00:45 2016 +0530 +++ b/src/share/classes/java/lang/Thread.java Fri Dec 16 20:39:07 2016 +0000 @@ -342,11 +342,11 @@ /** * Initializes a Thread with the current AccessControlContext. - * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext) + * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext,boolean) */ private void init(ThreadGroup g, Runnable target, String name, long stackSize) { - init(g, target, name, stackSize, null); + init(g, target, name, stackSize, null, true); } /** @@ -359,9 +359,12 @@ * zero to indicate that this parameter is to be ignored. * @param acc the AccessControlContext to inherit, or * AccessController.getContext() if null + * @param inheritThreadLocals if {@code true}, inherit initial values for + * inheritable thread-locals from the constructing thread */ private void init(ThreadGroup g, Runnable target, String name, - long stackSize, AccessControlContext acc) { + long stackSize, AccessControlContext acc, + boolean inheritThreadLocals) { if (name == null) { throw new NullPointerException("name cannot be null"); } @@ -412,7 +415,7 @@ acc != null ? acc : AccessController.getContext(); this.target = target; setPriority(priority); - if (parent.inheritableThreadLocals != null) + if (inheritThreadLocals && parent.inheritableThreadLocals != null) this.inheritableThreadLocals = ThreadLocal.createInheritedMap(parent.inheritableThreadLocals); /* Stash the specified stack size in case the VM cares */ @@ -466,7 +469,7 @@ * This is not a public constructor. */ Thread(Runnable target, AccessControlContext acc) { - init(null, target, "Thread-" + nextThreadNum(), 0, acc); + init(null, target, "Thread-" + nextThreadNum(), 0, acc, false); } /**