Unexpected thread wakeup
问题 I was expecting the second thread in the following example to hang, since it waits on an object with no corresponding notify. Instead, it falls through to the println, presumably due to a spurious wakeup. public class Spurious { public static void main(String[] args) { Thread t1 = new Thread() { public void run() { System.out.println("Hey!"); } }; Thread t2 = new Thread() { public void run() { try { synchronized (t1) { t1.wait(); } } catch (InterruptedException e) { return; } System.out