Package edu.wpi.first.wpilibj
Class Threads
java.lang.Object
edu.wpi.first.wpilibj.Threads
public final class Threads extends Object
Thread utility functions.
-
Method Summary
Modifier and Type Method Description static boolean
getCurrentThreadIsRealTime()
Get if the current thread is real-time.static int
getCurrentThreadPriority()
Get the thread priority for the current thread.static boolean
setCurrentThreadPriority(boolean realTime, int priority)
Sets the thread priority for the current thread.
-
Method Details
-
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
Get if the current thread is real-time.- Returns:
- If the current thread is real-time.
-
setCurrentThreadPriority
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.
-