On Sat, 12 Dec 1998, Carlos Alberto Roman Zamitiz wrote:

> I have a problem with threads: My java client contains 2 threads which
> call to 2 methods. First thread calls method "x" into while(true) but when
> second thread calls method "y", first thread must wait. When second thread
> finish method "y" must notify and first thread will awake.
> 
> But I receive this message:
> java.lang.IllegalMonitorStateException: current thread not owner

Your two threads must wait and notify on the same object, and must also be
synchronized on the same object.

. . . Sean.

Reply via email to