Simplify tick loop

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-09-14 04:36:10 +02:00
parent 983850171b
commit 8fce62ccba

View File

@ -25,13 +25,10 @@ public final class TickThread extends Thread {
@Override
public void run() {
LockSupport.park(this);
while (!stop) {
final Runnable localRunnable = tickRunnable;
if (localRunnable != null) {
localRunnable.run();
this.tickRunnable = null;
this.phaser.arriveAndDeregister();
}
this.tickRunnable.run();
this.phaser.arriveAndDeregister();
LockSupport.park(this);
}
}