mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-12 13:44:28 +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
|
||||
public void run() {
|
||||
LockSupport.park(this);
|
||||
while (!stop) {
|
||||
final Runnable localRunnable = tickRunnable;
|
||||
if (localRunnable != null) {
|
||||
localRunnable.run();
|
||||
this.tickRunnable = null;
|
||||
this.tickRunnable.run();
|
||||
this.phaser.arriveAndDeregister();
|
||||
}
|
||||
LockSupport.park(this);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user