private List testList;
testList= new ArrayList();
testList.wait(); //什么含义?

解决方案 »

  1.   

    Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
    使当前线程进入等待状态,直到被其他线程唤起
      

  2.   

    线程间互相通讯的一种手段。
    当你调用testList.wait();的时候,当前线程会一直堵塞在这个方法上面。
    知道另外一个线程调用testList.notify()或者testList.notifyAll(),你的testList.wait()后面的代码才能被执行。