changeset 6874:716638f9efdf

6974093: Thread.clone should NOT invoke addUnstarted on started threads Reviewed-by: dholmes, coffeys
author chegar
date Wed, 11 Aug 2010 09:32:38 +0100
parents 7fe1f614001e
children 81d6ec3397e5
files jdk/src/share/classes/java/lang/Thread.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/java/lang/Thread.java	Thu Jul 22 17:26:33 2010 +0100
+++ b/jdk/src/share/classes/java/lang/Thread.java	Wed Aug 11 09:32:38 2010 +0100
@@ -441,7 +441,9 @@
             t.threadLocals = null;
 
             group.checkAccess();
-            group.addUnstarted();
+            if (threadStatus == 0) {
+                group.addUnstarted();
+            }
             t.setPriority(priority);
 
             final Thread current = Thread.currentThread();