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. Intro to adding new linux binaries

Hi,

Can you point me to a description on how I would add new linux
binaries to android so I can compile them together? For example, which
directory they should go in and other things to consider.

thanks!

Chris

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. A bit of guidance

I've been asked to look into porting a library I've developed for
iPhone to Andriod. The library provides an interface to my clients web
service using http allowing third parties to easily write iPhone apps
that utilize their services.

Being totally new to Andriod platform have a few basic questions
before I start looking further. Also although I have exposure to Java
but would not consider myself an expert as yet.

Does it make sense, or even is a viable option, to provide the library
as a jar that third parties could use in their applications? If not
what would the best approach be?

What facilities does the platform provide for making asynchronous http
requests? The existing API runs all i/o asynchronously providing
notification of progress by calling methods on client app provided
delegate objects. Having had a brief look through the SDK not clear
how to do async requests.

Any guidance much appreciated.

Thanks
Mark

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

3. FTP

4. mapview overlay with button like googlemap

5. __thread in Android

6. How to detect orientation changed event in the webpage

7. URGENT: install sqlite db on Android phone???