Class TickingThread

java.lang.Object
com.hypixel.hytale.server.core.util.thread.TickingThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
World, WorldMapManager

public abstract class TickingThread extends Object implements Runnable
  • Field Details

    • NANOS_IN_ONE_MILLI

      public static final int NANOS_IN_ONE_MILLI
      See Also:
    • NANOS_IN_ONE_SECOND

      public static final int NANOS_IN_ONE_SECOND
      See Also:
    • TPS

      public static final int TPS
      See Also:
    • SLEEP_OFFSET

      public static long SLEEP_OFFSET
    • threadName

      private final String threadName
    • daemon

      private final boolean daemon
    • needsShutdown

      private final AtomicBoolean needsShutdown
    • tps

      private int tps
    • tickStepNanos

      private int tickStepNanos
    • bufferedTickLengthMetricSet

      private HistoricMetric bufferedTickLengthMetricSet
    • thread

      @Nullable private Thread thread
    • startedFuture

      @Nonnull private CompletableFuture<Void> startedFuture
  • Constructor Details

    • TickingThread

      public TickingThread(String threadName)
    • TickingThread

      public TickingThread(String threadName, int tps, boolean daemon)
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • isIdle

      protected boolean isIdle()
    • tick

      protected abstract void tick(float var1)
    • onStart

      protected void onStart()
    • onShutdown

      protected abstract void onShutdown()
    • start

      @Nonnull public CompletableFuture<Void> start()
    • interrupt

      public boolean interrupt()
    • stop

      public void stop()
    • setTps

      public void setTps(int tps)
    • getTps

      public int getTps()
    • getTickStepNanos

      public int getTickStepNanos()
    • getBufferedTickLengthMetricSet

      public HistoricMetric getBufferedTickLengthMetricSet()
    • clearMetrics

      public void clearMetrics()
    • debugAssertInTickingThread

      public void debugAssertInTickingThread()
    • isInThread

      public boolean isInThread()
    • isStarted

      public boolean isStarted()
    • setThread

      @Deprecated protected void setThread(Thread thread)
      Deprecated.
    • getThread

      @Nullable protected Thread getThread()