@Test public void removeFromWaitingThreadTable() throws Exception { final WaitNotifyObject waitNotifyObject = new WaitNotifyObject(); for (int i = 0; i < 5; i++) { Thread t = new Thread(new Runnable() { @Override public void run() { waitNotifyObject.allWaitForRunning(100); waitNotifyObject.removeFromWaitingThreadTable(); } }); t.start(); t.join(); } Assert.assertEquals(0, waitNotifyObject.waitingThreadTable.size()); }
public void removeFromWaitingThreadTable() { long currentThreadId = Thread.currentThread().getId(); synchronized (this) { this.waitingThreadTable.remove(currentThreadId); } }
WaitNotifyObject { public void removeFromWaitingThreadTable() { long currentThreadId = Thread.currentThread().getId(); synchronized (this) { this.waitingThreadTable.remove(currentThreadId); } } }
WaitNotifyObject { public void removeFromWaitingThreadTable() { long currentThreadId = Thread.currentThread().getId(); synchronized (this) { this.waitingThreadTable.remove(currentThreadId); } }  }
WaitNotifyObject { public void removeFromWaitingThreadTable() { long currentThreadId = Thread.currentThread().getId(); synchronized (this) { this.waitingThreadTable.remove(currentThreadId); } }  void wakeup(); void wakeupAll(); void allWaitForRunning(long interval); void removeFromWaitingThreadTable(); }
WaitNotifyObject { public void removeFromWaitingThreadTable() { long currentThreadId = Thread.currentThread().getId(); synchronized (this) { this.waitingThreadTable.remove(currentThreadId); } }  void wakeup(); void wakeupAll(); void allWaitForRunning(long interval); void removeFromWaitingThreadTable();  }