Why is this dispatch_sync() call freezing?
I'm using the Kiwi testing framework to test an authentication method in my app. The test freezes at a call to dispatch_sync which looks like this: dispatch_queue_t main = dispatch_get_main_queue(); dispatch_sync(main, ^ { [[NSNotificationCenter defaultCenter] postNotificationName:kNotificationAuthenticationSuccess object:nil userInfo:ret]; }); I'd like to know why it freezes there, if anyone has any hints. For the second part of your question regarding the hint on the freeze: When calling dispatch_sync on a queue, always verify that this queue is not already the current queue ( dispatch_get