lock.notify();
lock.notifyAll();
   public BufferedImage getImageBuffer(int width, int height) {      synchronized (lock) {         if (bi == null || bi.getWidth() != width || bi.getHeight() != height)            // allocate a buffer Image with appropriate size            bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);            this.width = width;            this.height = height;         // tell waiting threads to wake up         lock.notify();      }      return bi;   }