Package rekit.util

Class ThreadUtils

java.lang.Object
rekit.util.ThreadUtils

public final class ThreadUtils extends Object
This class contains several methods for a better usability of Threads.
Author:
Dominik Fuchss
  • Method Details

    • sleep

      public static boolean sleep(long time)
      Parameters:
      time - length of time to sleep in milliseconds
      Returns:
      true if successfully sleeped the time, false otherwise
    • runDaemon

      public static Thread runDaemon(String name, Runnable r)
      Run a Runnable as daemon.
      Parameters:
      name - the name of the daemon
      r - the runnable
      Returns:
      the thread
    • runThread

      public static Thread runThread(String name, Runnable r)
      Run a Runnable not a daemon.
      Parameters:
      name - the name of the thread
      r - the runnable
      Returns:
      the thread