code: public static void wait(Object lock, long timeout) {
  	try {
  	    synchronized (lock) {
  		lock.wait(timeout);
  	    }
  	}
  	catch (InterruptedException e) {}
      }
docs: locks the object (synchronized) before calling wait
  
  @param lock
  @param timeout
  @throws InterruptedException