Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在后台几分钟再回到前台会死锁 #135

Open
karosLi opened this issue Jan 13, 2020 · 1 comment
Open

在后台几分钟再回到前台会死锁 #135

karosLi opened this issue Jan 13, 2020 · 1 comment

Comments

@karosLi
Copy link

karosLi commented Jan 13, 2020

我自己本地没有复现处理,bugly 上的日志在这里。不确定是什么情况下导致 HTTPServer 会被释放掉.

Thread 24

0 libdispatch.dylib _DISPATCH_WAIT_FOR_QUEUE + 448
1 libdispatch.dylib __dispatch_sync_f_slow + 140
2 libdispatch.dylib __dispatch_sync_f_slow + 140
3 App -[HTTPServer stop:] + 168
4 App -[HTTPServer dealloc] + 164
5 App __destroy_helper_block.306 + 24
6 libsystem_blocks.dylib _Block_release + 152
7 libdispatch.dylib __dispatch_client_callout + 16
8 libdispatch.dylib __dispatch_lane_serial_drain$VARIANT$armv81 + 564
9 libdispatch.dylib __dispatch_lane_invoke$VARIANT$armv81 + 400
10 libdispatch.dylib __dispatch_workloop_worker_thread + 576
11 libsystem_pthread.dylib _pthread_wqthread + 276
@karosLi
Copy link
Author

karosLi commented Jan 14, 2020

另外看到很多这样的写法,dispatch_sync(serverQueue, ^{ @autoreleasepool {}}); 目的是为了什么呢?同步执行会阻塞,当是主线程调用时,如果 serverQueue 有其他任务,主线程还会被阻塞住

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant