6

i make a url-Request and waiting for the answer with

I start the request, then waiting until synchronousOperationComplete=TRUE

NSRunLoop *theRL = [NSRunLoop currentRunLoop];

while (!synchronousOperationComplete && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);

then I return the response

all seems to be ok,i get the response and everything is working normal, but when I close the app i get:

bool _WebTryThreadLock(bool), 0x227f40: Multiple locks on web thread not allowed! Please file a bug. Crashing now...

1   _ZL17_WebTryThreadLockb
2   _ZL14WebRunLoopLockP19__CFRunLoopObservermPv
3   __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
4   __CFRunLoopDoObservers
5   __CFRunLoopRun
6   CFRunLoopRunSpecific
7   CFRunLoopRunInMode
8   _ZL12RunWebThreadPv
9   _pthread_start
10  thread_start

it seems to be the NSRunLoop what causes the error, when I commend it out the error doesn't appear.

I use IOS 5.0 does someone have a clue what I can do to avoid this error?

i used this in IOS 4.3 and IOS5 Beta and it works fine.

but i moved my tomcat6 to an other server, maybe it is an error of the server

THX mBax

Starbax
  • 1,005
  • 2
  • 12
  • 32
  • 1
    Please expand the NSRunLoop *theRL = [NSRunLoop currentRunLoop]; line cause it's not clear what you are doing after. – Max Nov 07 '11 at 14:03

3 Answers3

3

I just had the same error message, but I tried to call a stringByEvaluatingJavaScript on a webView that wasn't on screen.

In general this message hints that something is trying to access an item (UIWebView) while the particular thread of this item is locked.

auco
  • 9,329
  • 4
  • 47
  • 54
2

If you have used the following code:

[[NSRunLoop currentRunLoop ] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.0]];

Remove it if not needed, or reduce the time interval. It worked for me.

Vishwani
  • 623
  • 6
  • 8
0

For me it was a view that was added on

- (void)applicationDidEnterBackground:(UIApplication *)application{}

i commended it out and now it woks!

https://devforums.apple.com/message/575760#575760

may help if someone has the same error

Starbax
  • 1,005
  • 2
  • 12
  • 32