geforkt von Mirrors/Paper
Name craft scheduler threads according to the plugin using them
Provides quick access to culprits running far more threads than they should be
Dieser Commit ist enthalten in:
Ursprung
32107198d1
Commit
e14d95e83c
@ -25,7 +25,10 @@ class CraftAsyncTask extends CraftTask {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
final Thread thread = Thread.currentThread();
|
final Thread thread = Thread.currentThread();
|
||||||
synchronized (this.workers) {
|
// Paper start - name threads according to running plugin
|
||||||
|
final String nameBefore = thread.getName();
|
||||||
|
thread.setName(nameBefore + " - " + this.getOwner().getName());
|
||||||
|
try { synchronized (this.workers) { // Paper end - name threads according to running plugin
|
||||||
if (this.getPeriod() == CraftTask.CANCEL) {
|
if (this.getPeriod() == CraftTask.CANCEL) {
|
||||||
// Never continue running after cancelled.
|
// Never continue running after cancelled.
|
||||||
// Checking this with the lock is important!
|
// Checking this with the lock is important!
|
||||||
@ -92,6 +95,7 @@ class CraftAsyncTask extends CraftTask {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally { thread.setName(nameBefore); } // Paper - name threads according to running plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkedList<BukkitWorker> getWorkers() {
|
LinkedList<BukkitWorker> getWorkers() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren