日期:2014-05-19  浏览次数:20793 次

线程stop的时候,显示The method stop() is deprecated会有什么后果?
如下代码所示,在用stop结束线程时,stop被横线划掉了。而且报这个警告The method stop() from the type Thread is deprecated。会对线程的执行有影响吗?

Java code

        tran_input = new Thread(new ActTranIn());
        tran_input.start();
                /**执行SSLSocket接受数据的代码。。。省略**/
        tran_input.stop();

            class ActTranIn implements Runnable {
                public void run() {
                          /**执行SSLSocket发送数据的代码。。。省略**/
                        }
                }



------解决方案--------------------
http://blog.csdn.net/DLite/article/details/4212915
------解决方案--------------------
会执行的 你可以不用管警告
------解决方案--------------------
Thread.stop()有bug的,有时候抛出运行时异常。所以不见意用这个方法。