Skip to content

Commit

Permalink
fix: allow game to quit without waiting for registry updater thread (#…
Browse files Browse the repository at this point in the history
…3953)

set it to daemon-mode and give it a name for easier troubleshooting.
  • Loading branch information
keturn authored Aug 10, 2020
1 parent 7df2c34 commit 25b81f4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
*/
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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 25b81f4

Please sign in to comment.