up = true;
			public void run() {				try {					up = true;					long before, after, sleep;					stop: while (up) {						before = System.currentTimeMillis();						synchronized (Tetris.class) {							while (pause) {								try {									System.out.println("waiting");									Tetris.class.wait();									System.out.println("back from waiting");								} catch (InterruptedException ignore) {								}								if (!up)									break stop;							}						}						if (hasRoom(bi, x, y + 1)) {							y++;							repaint();						} else {							newBlock();							if (!hasRoom(bi, x, y)) {								up = false;								end = true;								repaint();							}						}						after = System.currentTimeMillis();						sleep = delay - (after - before);						sleep = sleep < 0 ? delay : sleep;						try {							Thread.sleep(sleep);						} catch (InterruptedException ignore) {						}					}				} catch (Throwable ex) {					ex.printStackTrace();				}			}