Merge only gpu and platform threads for platform views, fix deadlock. (#8045)
The reason we didn't merge just the gpu and platform threads from the get go was a deadlock in Shell:OnPlatformViewCreated and Shell:OnPlatformViewDestroyed. The deadlock was caused by the platform thread starting a thread-hopping flow that ends ends up with the gpu thread releasing a latch that the platform thread is waiting on just after starting the cross-thread dance. If the platform and gpu threads are the same, that last task that is posted to the gpu thread will never get executed as the gpu/platform thread is blocked on a latch. This works around the deadlock by having a special case in the code for the scenario where the gpu and platform threads are the same. Fixes: flutter/flutter#23974
Showing
想要评论请 注册 或 登录