提交 aedd569a 编写于 作者: C chegar

6968584: Thread should not be Cloneable

Reviewed-by: dholmes
上级 3179dda2
...@@ -413,6 +413,18 @@ class Thread implements Runnable { ...@@ -413,6 +413,18 @@ class Thread implements Runnable {
tid = nextThreadID(); tid = nextThreadID();
} }
/**
* Throws CloneNotSupportedException as a Thread can not be meaningfully
* cloned. Construct a new Thread instead.
*
* @throws CloneNotSupportedException
* always
*/
@Override
protected Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
/** /**
* Allocates a new {@code Thread} object. This constructor has the same * Allocates a new {@code Thread} object. This constructor has the same
* effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread} * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册