IllegalMonitorStateException « Notify « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » Notify » IllegalMonitorStateException 

1. wait, notify IllegalMonitorStateException    coderanch.com

Hallo! I am trying to program a producer / consumer example. I am getting a IllegalMonitorStateException trying to call wait() although I have synchronized on the object I am calling wait() on. public class MessageConsumer implements Runnable { private MessageProducer producer; public MessageConsumer(MessageProducer producer) { super(); this.producer = producer; } public void run() { synchronized (this.producer) { while (true) { try ...

2. Problem with wait(), notify() and IllegalMonitorStateException    coderanch.com

Hey, my threading seems to be a little rusty. I am creating a TestCase for JDBCSupport and trying to provoke an exception that is thrown when different threads use Connection objects and try to use those once they are released back into the pool. The problem is when I invoke wait I am getting an IllegalMonitorStateException and I have no clue ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.