Putting waits outside loops is called naked wait, and can cause issues when signalAll is called and also when there are spurious wake ups:
http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#wait%28long%29