synchronized object not locked by thread before notifyAll()
问题 I want to have a boolean to notify some sections of the system that a specific service started. For some strange reason I'm getting the error java.lang.IllegalMonitorStateException: object not locked by thread before notifyAll() . What is strange is that the notifyAll() is inside a synchronized block that takes control over the object that I call notifyAll() on. My class starts like this: public class MyService { public static Boolean notifier = Boolean.valueOf(false); @Override public void