mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 22:47:49 +01:00
Cleanup un-needed changes
This commit is contained in:
parent
85ca2a5302
commit
b1b1e70c40
@ -184,9 +184,9 @@ public final class SchedulerManager implements IExtensionObserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the execution service for all the registered {@link Task}, which are not marked as thread-bound.
|
* Gets the execution service for all the registered {@link Task}
|
||||||
*
|
*
|
||||||
* @return the execution service for all the registered {@link Task}, which are not marked as thread-bound
|
* @return the execution service for all the registered {@link Task}
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public ExecutorService getBatchesPool() {
|
public ExecutorService getBatchesPool() {
|
||||||
|
@ -43,8 +43,6 @@ public class Task implements Runnable {
|
|||||||
private ScheduledFuture<?> future;
|
private ScheduledFuture<?> future;
|
||||||
// The thread of the task
|
// The thread of the task
|
||||||
private volatile Thread currentThreadTask;
|
private volatile Thread currentThreadTask;
|
||||||
// The executor service used for this task
|
|
||||||
private final ExecutorService executorService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a task.
|
* Creates a task.
|
||||||
@ -60,7 +58,6 @@ public class Task implements Runnable {
|
|||||||
this.runnable = runnable;
|
this.runnable = runnable;
|
||||||
this.shutdown = shutdown;
|
this.shutdown = shutdown;
|
||||||
this.id = shutdown ? this.schedulerManager.getShutdownCounterIdentifier() : this.schedulerManager.getCounterIdentifier();
|
this.id = shutdown ? this.schedulerManager.getShutdownCounterIdentifier() : this.schedulerManager.getCounterIdentifier();
|
||||||
this.executorService = this.schedulerManager.getBatchesPool();
|
|
||||||
this.delay = delay;
|
this.delay = delay;
|
||||||
this.repeat = repeat;
|
this.repeat = repeat;
|
||||||
this.isTransient = isTransient;
|
this.isTransient = isTransient;
|
||||||
@ -72,7 +69,7 @@ public class Task implements Runnable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
executorService.execute(() -> {
|
this.schedulerManager.getBatchesPool().execute(() -> {
|
||||||
this.currentThreadTask = Thread.currentThread();
|
this.currentThreadTask = Thread.currentThread();
|
||||||
try {
|
try {
|
||||||
this.runnable.run();
|
this.runnable.run();
|
||||||
|
Loading…
Reference in New Issue
Block a user