Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AssetServer::get_asset_loader deadlock
A thread could take the extension_to_loader_index read lock, and then have the `server.loader` write lock taken in add_loader before it can. Then add_loader can't take the extension_to_loader_index lock, and the program deadlocks. Fixed by descoping the extension_to_loader_index lock, since get_asset_loader doesn't need to hold the lock for the duration, just to get a copiable usize. The block might not be needed, I think I could have gotten away with just inserting a `copied()` call into the chain, but I wanted to make the reasoning clear for future maintainers.
- Loading branch information