问题描述
我在我的应用程序中遇到了一个竞争条件,每当我暂停调试时,除了1个线程之外的所有或所有线程都会卡在syscall_thread_switch上。它可以在模拟器上更频繁地再现,也可以在iPad Air上再现。在CocoaLumberjack的queueLogMessage中总共至少有2个线程: - 请参见截图。
I'm hitting a race-condition in my app, where all or all but 1 threads get stuck on syscall_thread_switch whenever I pause debugging. It reproduces much more often on the simulator, but also on the iPad Air. There is ALWAYS at least 2 threads stuck in CocoaLumberjack's queueLogMessage: -- see screenshots.
我以前从未在8.1和8.2上看过这个,但我经常在8.3上看到它。我并没有声称这是一个8.3错误:)
I've never seen this before on 8.1 and 8.2, but i'm hitting it often on 8.3. I'm not claiming this is an 8.3 bug :)
这是我以前从未调试过的复杂程度,所以我不知道该怎么做做。我希望我能提供足够的信息,如果您需要更多信息,请告诉我(如果信息不清楚,请具体说明如何获取信息)。你能帮我调试一下吗?!数百万的感谢。
This is a level of complexity i've never had to debug before, so i'm not sure what to do. I hope I'm providing enough information, please let me know if you need more (please be specific about how to get the information if it isn't dead clear). Can you please help me debug this?! Millions of thanks.
推荐答案
我在iOS 8.3的NSOperationQueue中遇到了与NSOperations类似的问题(与CocoaLumberjack无关)。我有并发操作创建自己的线程,不再需要它。它在8.2中表现得非常好,但不是8.3。
I hit a similar issue with NSOperations in a NSOperationQueue in iOS 8.3 (not related to CocoaLumberjack). I had concurrent operations creating their own threads, which is no-longer needed. It behaved perfectly well in 8.2, but not 8.3.
在start方法中我只需更换:
In the start method I simply replaced:
[NSThread detachNewThreadSelector:@selector(main) toTarget:self withObject:nil];
使用:
[self main];
这篇关于syscall_thread_switch iOS 8.3竞赛 - CocoaLumberjack错误?怎么调试这个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!