fix: allow game to quit without waiting for registry updater thread
set it to daemon-mode and give it a name for easier troubleshooting.
*/
package org.terasology.rendering.nui.layers.mainMenu.advancedGameSetupScreen;
+import ch.qos.logback.classic.pattern.TargetLengthBasedClassNameAbbreviator;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -130,8 +132,11 @@ public void onOpened() {
@Override
public void initialise() {
setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation());
- remoteModuleRegistryUpdater = Executors.newSingleThreadExecutor()
- .submit(moduleManager.getInstallManager().updateRemoteRegistry());
+ remoteModuleRegistryUpdater = Executors.newSingleThreadExecutor(
+ new ThreadFactoryBuilder()
+ .setNameFormat(new TargetLengthBasedClassNameAbbreviator(36).abbreviate(getClass().getName()) + "-%d")
+ .setDaemon(true)
+ .build()).submit(moduleManager.getInstallManager().updateRemoteRegistry());
final UIText seed = find("seed", UIText.class);
if (seed != null) {
