问题
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
回答1:
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.
回答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.
回答3:
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
来源:https://stackoverflow.com/questions/8037407/multiple-locks-on-web-thread-not-allowed-please-file-a-bug-crashing-now