mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-13 22:25:53 +01:00
Simplify tick loop
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
983850171b
commit
8fce62ccba
@ -25,13 +25,10 @@ public final class TickThread extends Thread {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
LockSupport.park(this);
|
||||||
while (!stop) {
|
while (!stop) {
|
||||||
final Runnable localRunnable = tickRunnable;
|
this.tickRunnable.run();
|
||||||
if (localRunnable != null) {
|
|
||||||
localRunnable.run();
|
|
||||||
this.tickRunnable = null;
|
|
||||||
this.phaser.arriveAndDeregister();
|
this.phaser.arriveAndDeregister();
|
||||||
}
|
|
||||||
LockSupport.park(this);
|
LockSupport.park(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user