Possible Duplicate:
App blocks while dipatching a queue
I'm using XMPPFramework, and in its code there's a method like this:
- (NSDictionary *)occupants
{
if (dispatch_get_current_queue() == moduleQueue)
{
return occupants;
}
else
{
__block NSDictionary *result;
dispatch_sync(moduleQueue, ^{//IT BLOCKS HERE
result = [occupants copy];
});
return [result autorelease];
}
}
It gets stuck there inconsistently, not always; the app is not responding, but it's not crashing, so I pause it and I see the thread (Thread 1) has stopped there. If I press play, nothing changes. What is wrong? Any ideas?