Class Threads

java.lang.Object
edu.wpi.first.wpilibj.Threads

public final class Threads
extends Object
  • Method Details

    • getCurrentThreadPriority

      public static int getCurrentThreadPriority()
      Get the thread priority for the current thread.
      Returns:
      The current thread priority. For real-time, this is 1-99 with 99 being highest. For non-real-time, this is 0. See "man 7 sched" for details.
    • getCurrentThreadIsRealTime

      public static boolean getCurrentThreadIsRealTime()
      Get if the current thread is real-time.
      Returns:
      If the current thread is real-time.
    • setCurrentThreadPriority

      public static boolean setCurrentThreadPriority​(boolean realTime, int priority)
      Sets the thread priority for the current thread.
      Parameters:
      realTime - Set to true to set a real-time priority, false for standard priority.
      priority - Priority to set the thread to. For real-time, this is 1-99 with 99 being highest. For non-real-time, this is forced to 0. See "man 7 sched" for details.
      Returns:
      True on success.