Skip to content

Commit

Permalink
Name Galaxi threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Jan 6, 2019
1 parent 4879751 commit f6e3de4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GalaxiAPI/src/net/ME1312/Galaxi/Galaxi.java
Expand Up @@ -52,7 +52,7 @@ public void run() {
}
};

schedule.put(sid, new Timer("ScheduledTask_" + sid.toString()));
schedule.put(sid, new Timer(builder.plugin().getName() + "::Scheduled_Task(" + sid + ')'));
if (builder.repeat() > 0) {
if (builder.delay() > 0) {
schedule.get(sid).scheduleAtFixedRate(task, builder.delay(), builder.repeat());
Expand All @@ -63,7 +63,7 @@ public void run() {
if (builder.delay() > 0) {
schedule.get(sid).schedule(task, builder.delay());
} else {
new Thread(task).start();
new Thread(task, builder.plugin().getName() + "::Scheduled_Task(" + sid + ')').start();
}
}
return sid;
Expand Down
3 changes: 2 additions & 1 deletion GalaxiAPI/src/net/ME1312/Galaxi/Library/Log/Logger.java
@@ -1,5 +1,6 @@
package net.ME1312.Galaxi.Library.Log;

import net.ME1312.Galaxi.Galaxi;
import net.ME1312.Galaxi.Library.Container;
import net.ME1312.Galaxi.Library.NamedContainer;
import net.ME1312.Galaxi.Library.Util;
Expand Down Expand Up @@ -182,6 +183,6 @@ private static void log() {
}
Util.isException(() -> Thread.sleep(32));
}
})).start();
}, Galaxi.getInstance().getEngineInfo().getName() + "::Log_Spooler")).start();
}
}
Expand Up @@ -336,7 +336,7 @@ public void run() throws Throwable {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
new Thread() {
new Thread(Galaxi.getInstance().getEngineInfo().getName() + "::AWT_Shutdown") {
@Override
public void run() {
try {
Expand Down Expand Up @@ -431,7 +431,7 @@ public void hyperlinkUpdate(HyperlinkEvent e) {
public void actionPerformed(ActionEvent event) {
if (input.getText().length() > 0 && !input.getText().equals(">")) {
final String command = (input.getText().startsWith(">"))?input.getText().substring(1):input.getText();
new Thread() {
new Thread(Galaxi.getInstance().getEngineInfo().getName() + "::AWT_Command") {
@Override
public void run() {
try {
Expand Down
Expand Up @@ -181,7 +181,7 @@ public void start(Runnable callback) {
pluginManager.executeEvent(new GalaxiStartEvent(this));
} catch (Exception e) {}

new Timer().schedule(new TimerTask() {
new Timer(getEngineInfo().getName() + "::Routine_Update_Check").schedule(new TimerTask() {
@Override
public void run() {
try {
Expand Down
Expand Up @@ -115,7 +115,7 @@ public void command(CommandSender sender, String handle, String[] args) {
if (engine.getPluginManager().getPlugins().get(args[0].toLowerCase()).getUpdateChecker() != null) Util.isException(() -> engine.getPluginManager().getPlugins().get(args[0].toLowerCase()).getUpdateChecker().run());
}
checking = false;
}).start();
}, Galaxi.getInstance().getEngineInfo().getName() + "::Update_Check").start();
}
} else {
sender.sendMessage("There is no plugin with that name");
Expand Down

0 comments on commit f6e3de4

Please sign in to comment.