你是在调用join以后判断吗?
我在join以后判断是false

解决方案 »

  1.   

    我是这样:
    线程1,2,3
    在线程1中执行2.start(),2执行完毕后,在3中检查2.isAlive(),一直是true
      

  2.   

    public void run()
        {
            Thread me = Thread.currentThread();
            while (nowThread == me)
            {
                try
                {
                    Thread.currentThread().sleep(30000);
                } 
                catch (InterruptedException e)
                {
                }
                System.out.println("thread run !!!!!");
            }
        }
      

  3.   

    能不能把代码贴出来,你这样说我也不明白
    不过isAlive是一个native方法,所以同下层os的关系也应该有
    你用的什么操作系统?
      

  4.   

    代码如下:setStop是停止这个线程的方法,而且根据输出的信息,应该结束了。但一直输出“alive”
    -------------------------------------------      // 停止线程
          Application.scanTimeSequence.setStop();
          while (endTime.after(Calendar.getInstance())) {
            Thread.currentThread().sleep(1000);
            if (!(Application.scanDBRequest.isAlive())) {
              result = "success";
              System.out.println("not alive");
              //break;
            }
            if (Application.scanDBRequest.isAlive()) {
              System.out.println("alive");
              //break;
            }
          }
      

  5.   

    问题是你的setStop方法是如何停止这个现成的?
    有无说明?