提交 dac69aaa 编写于 作者: C chegar

8031050: (thread) Change Thread initialization so that thread name is set...

8031050: (thread) Change Thread initialization so that thread name is set before invoking SecurityManager
Reviewed-by: alanb, dholmes, mchung
上级 f70d962b
...@@ -366,6 +366,8 @@ class Thread implements Runnable { ...@@ -366,6 +366,8 @@ class Thread implements Runnable {
throw new NullPointerException("name cannot be null"); throw new NullPointerException("name cannot be null");
} }
this.name = name.toCharArray();
Thread parent = currentThread(); Thread parent = currentThread();
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
if (g == null) { if (g == null) {
...@@ -402,7 +404,6 @@ class Thread implements Runnable { ...@@ -402,7 +404,6 @@ class Thread implements Runnable {
this.group = g; this.group = g;
this.daemon = parent.isDaemon(); this.daemon = parent.isDaemon();
this.priority = parent.getPriority(); this.priority = parent.getPriority();
this.name = name.toCharArray();
if (security == null || isCCLOverridden(parent.getClass())) if (security == null || isCCLOverridden(parent.getClass()))
this.contextClassLoader = parent.getContextClassLoader(); this.contextClassLoader = parent.getContextClassLoader();
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册