Set name of unnamed threads

This commit is contained in:
johni0702
2015-05-24 15:18:41 +02:00
parent 1c9a04d1dc
commit 538e95ad95
12 changed files with 25 additions and 25 deletions

View File

@@ -52,7 +52,7 @@ public class ChatMessageHandler {
} }
} }
} }
}); }, "replaymod-chat-message-handler");
public ChatMessageHandler() { public ChatMessageHandler() {
t.start(); t.start();

View File

@@ -86,7 +86,7 @@ public class GuiPlayerOverview extends GuiScreen {
e.printStackTrace(); e.printStackTrace();
} }
} }
}).start(); }, "replaymod-skin-loader").start();
} }
playerCount = players.size(); playerCount = players.size();

View File

@@ -114,7 +114,7 @@ public class GuiLoginPrompt extends GuiScreen {
break; break;
} }
} }
}).start(); }, "replaymod-auth").start();
} }
} else if(button.id == GuiConstants.LOGIN_CANCEL_BUTTON) { } else if(button.id == GuiConstants.LOGIN_CANCEL_BUTTON) {
mc.displayGuiScreen(parent); mc.displayGuiScreen(parent);

View File

@@ -200,7 +200,7 @@ public class GuiRegister extends GuiScreen {
message = I18n.format("replaymod.gui.login.connectionerror"); message = I18n.format("replaymod.gui.login.connectionerror");
} }
} }
}).start(); }, "replaymod-register").start();
break; break;
} }
} }

View File

@@ -390,7 +390,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
currentTab = Tab.RECENT_FILES; currentTab = Tab.RECENT_FILES;
updateCurrentList(new SearchPagination(recentFileSearchQuery)); updateCurrentList(new SearchPagination(recentFileSearchQuery));
} }
}); }, "replaymod-list-loader");
currentListLoader.start(); currentListLoader.start();
} }
@@ -402,7 +402,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
currentTab = Tab.BEST_FILES; currentTab = Tab.BEST_FILES;
updateCurrentList(new SearchPagination(bestFileSearchQuery)); updateCurrentList(new SearchPagination(bestFileSearchQuery));
} }
}); }, "replaymod-list-loader");
currentListLoader.start(); currentListLoader.start();
} }
@@ -414,7 +414,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
currentTab = Tab.DOWNLOADED_FILES; currentTab = Tab.DOWNLOADED_FILES;
updateCurrentList(new DownloadedFilePagination()); updateCurrentList(new DownloadedFilePagination());
} }
}); }, "replaymod-list-loader");
currentListLoader.start(); currentListLoader.start();
} }
@@ -427,7 +427,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
ReplayMod.favoritedFileHandler.reloadFavorites(); ReplayMod.favoritedFileHandler.reloadFavorites();
updateCurrentList(new FavoritedFilePagination()); updateCurrentList(new FavoritedFilePagination());
} }
}); }, "replaymod-list-loader");
currentListLoader.start(); currentListLoader.start();
} }

View File

@@ -241,7 +241,7 @@ public class GuiUploadFile extends GuiScreen {
e.printStackTrace(); e.printStackTrace();
} }
} }
}).start(); }, "replaymod-file-uploader").start();
} else if(button.id == GuiConstants.UPLOAD_CANCEL_BUTTON) { } else if(button.id == GuiConstants.UPLOAD_CANCEL_BUTTON) {
uploader.cancelUploading(); uploader.cancelUploading();
} }

View File

@@ -109,23 +109,23 @@ public class ConnectionEventHandler {
@Override @Override
public void run() { public void run() {
String worldName = null; String worldName = null;
while(worldName == null) { while (true) {
try { if (MinecraftServer.getServer() != null) {
worldName = MinecraftServer.getServer().getWorldName(); worldName = MinecraftServer.getServer().getWorldName();
listener.setWorldName(worldName); }
return; if (worldName == null) {
} catch(Exception e) {
try { try {
Thread.sleep(100); Thread.sleep(100);
} catch(InterruptedException e1) { } catch (InterruptedException e) {
e1.printStackTrace(); Thread.currentThread().interrupt();
} }
} else {
listener.setWorldName(worldName);
return;
} }
} }
} }
}).start(); }, "replaymod-world-name-fetcher").start();
} }
packetListener = listener; packetListener = listener;

View File

@@ -105,7 +105,7 @@ public abstract class DataListener extends ChannelInboundHandlerAdapter {
} }
} }
}); }, "replaymod-packet-writer");
public DataWriter(DataOutputStream stream) { public DataWriter(DataOutputStream stream) {
this.stream = stream; this.stream = stream;

View File

@@ -19,7 +19,7 @@ public class ReplayFileAppender extends Thread {
public void run() { public void run() {
ReplayFileAppender.this.shutdown(); ReplayFileAppender.this.shutdown();
} }
})); }, "replaymod-file-appender-shutdown"));
} }
public void registerModifiedFile(File toAdd, String name, File replayFile) { public void registerModifiedFile(File toAdd, String name, File replayFile) {

View File

@@ -155,7 +155,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
this.replayLength = file.metadata().get().getDuration(); this.replayLength = file.metadata().get().getDuration();
if (asyncMode) { if (asyncMode) {
new Thread(asyncSender).start(); new Thread(asyncSender, "replaymod-async-sender").start();
} }
} }
@@ -170,7 +170,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
this.asyncMode = asyncMode; this.asyncMode = asyncMode;
if (asyncMode) { if (asyncMode) {
this.terminate = false; this.terminate = false;
new Thread(asyncSender).start(); new Thread(asyncSender, "replaymod-async-sender").start();
} else { } else {
this.terminate = true; this.terminate = true;
} }

View File

@@ -96,7 +96,7 @@ public class ReplayScreenshot {
TickAndRenderListener.finishScreenshot(); TickAndRenderListener.finishScreenshot();
} }
} }
}); }, "replaymod-screenshot-saver");
ioThread.start(); ioThread.start();
} catch(Exception exception) { } catch(Exception exception) {

View File

@@ -110,7 +110,7 @@ public class VideoWriter {
e.printStackTrace(); e.printStackTrace();
} }
} }
}); }, "replaymod-video-writer");
writerThread.start(); writerThread.start();
} }