Hey there,
I've been fighting with these for a couple of days and I hope one of ya'll can help me. I understand that the monitors wait and notifyAll have to be called from synchronized code and probably not the same piece of synchronized code either. But when I use 2 different methods and try to call notifyAll from the second synchronized method, I get illegalMonitorStateException error. Is this because the
thread executing notifyAll doesn't have the lock on the waiting thread?
I'm callling the start method so that the 2 threads will run concurrently but for the life of me I can't seem to be able to notify either one. They seem to hang on the wait()
Can anyone help me? I'd introduce some code but it is really simple, try catch blocks with wait and notifyAll inside.
Thx
J