IllegalMonitorStateException on 'object.wait()' call randomly

by svd » Fri, 23 Apr 2010 08:04:51 GMT


Sponsored Links
 My code throws an IllegalMonitorStateException on 'object.wait()'
call, even though wait is invoked inside a synchronized block. And
this exception occurs only randomly not always.

below is my code snippet:

while (!mFinish) {
          synchronized (mResponse) {
                    if (!mResponse.isEmpty()) {
                           do something
                    } else {
                        try {
                            mResponse.wait(1000);
                        } catch (InterruptedException ie) {
                           ......
                        }
                    }

          }
}

Also all the 'notify' methods are in synchronized block.
Please point out if there is anything wrong in my code?

--



Other Threads

1. Discussion/Suggestions regarding SIP/RTP support on android.

Hello,
i have some questions.

1. Is there native RTP support on android?
2. Is there a media player for playing incoming rtp streams, or for
that matter streaming rtp audio video from the device?
3. I have a sip stack that runs on android. I wish to develop an
application on top of it. Before that, i wish to know, what should be
an ideal application footprint that can run on android. If there are
any best practices wiki pages...kindly point me to them.
4. I wish to provision some parameters on a java smart card. Is there
a way (api) provision on android so that i can read from that card on
application bootstrapping?
5. Is it possible for an android application to register for
callbacks, in case the mobile device goes out of radio coverage?

your help and answers are appreciated.
Thanks
aayush
--~--~---------~--~----~------------~-------~--~----~

2. Could not find method javax.microedition.io.Connector.open, referenced from method org.ksoap2.transport.ServiceConnectionMidp.

> I've been getting this error "Could not find method

Android is not JavaME and therefore does not contain javax.microedition.*
classes.

With regards to kSOAP2, there is a separate project where the Android port
of it is being maintained, though I don't have the URL handy right now.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~

3. Robots get real

4. Contacts won't sync

5. How to find the height of HTML content displayed in a webview

6. Extremely frustrating = TextView in ScrollView -> Scroll to bottom?

7. ProgressDialog - is there any way to set min duration?