-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: allow game to quit without waiting for registry updater thread #3953
fix: allow game to quit without waiting for registry updater thread #3953
Conversation
…exiting set it to daemon-mode and give it a name for easier troubleshooting.
The initial version of this I've provided here is deliberately verbose. Not that I want creating threads to be easy, but I certainly don't want the right way to be this much more difficult than the wrong way. The three qualities we've got here are:
and I threw in the abbreviator for good measure, but org.terasology.rendering.nui.layers.mainMenu.advancedGameSetupScreen.AdvancedGameSetupScreen#initialise is a really long string. |
Side note: Is it surprising that this is running as soon as the MainMenuScreen is initialized? The user may never visit the AdvancedGameSetupScreen. |
oh, that distracted me from what I was saying about my deliberately-verbose implementation. That's a straw man, posted here in the hope of generating discussion that will point toward an existing utility, or some agreement about where to add this as a new utility function. |
.submit(moduleManager.getInstallManager().updateRemoteRegistry()); | ||
remoteModuleRegistryUpdater = Executors.newSingleThreadExecutor( | ||
new ThreadFactoryBuilder() | ||
.setNameFormat(new TargetLengthBasedClassNameAbbreviator(36).abbreviate(getClass().getName()) + "-%d") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ModuleRegistryUpdater" sounds better and more ralate then "AdvancedGameSetupScreen"
Just tested this with and without the PR and the game exits correctly when closing. |
This fixes #3940. The thread that was holding things up there was this one that's updating the mod registry.
How to test
Outstanding before merging