lock.notify();
lock.notifyAll();
   public void resize(int width, int height) {      if (bi.getWidth() != width || bi.getHeight()  != height) {         synchronized (lock) {            bi = null;            bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);            this.width = width;            this.height = height;            // tell waiting threads to wake up            lock.notify();         }      }   }