-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The current implementation Shell:OnPlatformViewDestroyed is not compatible with thread merging.
For example on iOS, imagine an app contains a google map. When the map first shows up, the system alert view pops up for a location permission. The system alert view then triggers the ApplicationWillResignActive, which triggers Shell:OnPlatformViewDestroyed on the platform thread.
At the same time, the threads are about to merge on the raster thread because the google map view is about to show up at the next frame. If the merging thread happened after we check if the threads are merged here (We are not checking the thread merging now, which we also need to fix. But that's not the main issue here), we will still post the task to the "raster_task_runner" here. And the posted task is actually going to run on the platform thread, because the threads are merged when the task started. It leads to a dead lock because the platform thread is still waiting for this posted task to release it.