dcsimg
ThreadQuestions: java.lang.IllegalMonitorStateEx...
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Simon_Michnowicz
Posted On:   Tuesday, February 6, 2001 09:28 PM

ThreadQuestions: java.lang.IllegalMonitorStateException error??? **************** I am using 2 threads, and use the 'notify' and 'wait' methods to stop/start a timer thread. However when I call notify (from the parent thread) I get this exception thrown. Unknown exception java.lang.IllegalMonitorStateException According to the sun notes, this happens when the thread calling the Notify does not have a lock on the thread object. As both "wait" and "notify" are called from 'synchronised' mehtods, I am at a loss to explain why this error happens (which also crashes jbuilder). "wait" when called should release all locks, so any notify cal   More>>

ThreadQuestions: java.lang.IllegalMonitorStateException error???

****************
I am using 2 threads, and use the 'notify' and
'wait' methods to stop/start a timer thread.

However when I call notify (from the parent thread)
I get this exception thrown.

Unknown exception java.lang.IllegalMonitorStateException

According to the sun notes, this happens when the thread calling the Notify does not have a lock on
the thread object. As both "wait" and "notify" are called from 'synchronised' mehtods, I am at a loss
to explain why this error happens (which also crashes jbuilder). "wait" when called should release
all locks, so any notify call should in this case
have the lock on the synchronised method that calls
notify.

   <<Less
About | Sitemap | Contact