什么时候调用Java的thread.run()而不是thread.start()
发布于 2008-11-04 18:35:20
至少在JVM1.6.中,有一些检查和运行被本机调用:
public synchronized void start() {
/**
* This method is not invoked for the main method thread or "system"
* group threads created/set up by the VM. Any new functionality added
* to this method in the future may have to also be added to the VM.
*
* A zero status value corresponds to state "NEW".
*/
if (threadStatus != 0)
throw new IllegalThreadStateException();
group.add(this);
start0();
if (stopBeforeStart) {
stop0(throwableFromStop);
}
}
private native void start0();https://stackoverflow.com/questions/262816
复制相似问题