我有一个线程:
class SomeRunnable implements Runnable {
@Override
public void run() {
while (true) {
//some code...
try {
Thread.sleep(33);
} catch (InterruptedException e) {
return;
}
}
}
}
我开始使用的
someThread = new Thread(new SomeRunnable());
someThread.setName("SomeThread");
someThread.start();
如果我想停止线程,我只是中断它:
someThreat.interrupt();
以后如何恢复线程?
谢谢!