wait(), notify() and notifyAll() inside synchronized statement
I get following error when trying to do invoke notifyAll() inside a synchronized statement: Invoked Object.notify() outside synchronized context. Example: final List list = new ArrayList(); synchronized(list) {..... invoked notifyAll() here}; You can only call wait() , notify() , and notifyAll() on the object that is being synchronized on: synchronized (list) { //... list.notifyAll(); } In other words, the calling thread must own the object's monitor. If, inside synchronized (list) , you call notifyAll() , you are actually calling notifyAll() on this rather than list . My guess is that you are