mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Fix RT priority docs (NFC) (#3098)
The ranges and which value was specified as highest were incorrect on some of them. On Linux, the range is 1 to 99 with 99 being highest. From `man 7 sched`: ``` Processes scheduled under one of the real-time policies (SCHED_FIFO, SCHED_RR) have a sched_priority value in the range 1 (low) to 99 (high). ``` Also clean up the relevant javadoc and doxygen comments.
This commit is contained in:
@@ -12,16 +12,20 @@ namespace frc {
|
||||
* Get the thread priority for the specified thread.
|
||||
*
|
||||
* @param thread Reference to the thread to get the priority for.
|
||||
* @param isRealTime Set to true if thread is realtime, otherwise false.
|
||||
* @return The current thread priority. Scaled 1-99, with 1 being highest.
|
||||
* @param isRealTime Set to true if thread is real-time, otherwise false.
|
||||
* @return 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.
|
||||
*/
|
||||
int GetThreadPriority(std::thread& thread, bool* isRealTime);
|
||||
|
||||
/**
|
||||
* Get the thread priority for the current thread
|
||||
*
|
||||
* @param isRealTime Set to true if thread is realtime, otherwise false.
|
||||
* @return The current thread priority. Scaled 1-99.
|
||||
* @param isRealTime Set to true if thread is real-time, otherwise false.
|
||||
* @return 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.
|
||||
*/
|
||||
int GetCurrentThreadPriority(bool* isRealTime);
|
||||
|
||||
@@ -29,26 +33,24 @@ int GetCurrentThreadPriority(bool* isRealTime);
|
||||
* Sets the thread priority for the specified thread
|
||||
*
|
||||
* @param thread Reference to the thread to set the priority of.
|
||||
* @param realTime Set to true to set a realtime priority, false for standard
|
||||
* @param realTime Set to true to set a real-time priority, false for standard
|
||||
* priority.
|
||||
* @param priority Priority to set the thread to. Scaled 1-99, with 1 being
|
||||
* highest. On RoboRIO, priority is ignored for non realtime
|
||||
* setting.
|
||||
*
|
||||
* @return The success state of setting the priority
|
||||
* @param 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 more details.
|
||||
* @return True on success.
|
||||
*/
|
||||
bool SetThreadPriority(std::thread& thread, bool realTime, int priority);
|
||||
|
||||
/**
|
||||
* Sets the thread priority for the current thread
|
||||
*
|
||||
* @param realTime Set to true to set a realtime priority, false for standard
|
||||
* @param realTime Set to true to set a real-time priority, false for standard
|
||||
* priority.
|
||||
* @param priority Priority to set the thread to. Scaled 1-99, with 1 being
|
||||
* highest. On RoboRIO, priority is ignored for non realtime
|
||||
* setting.
|
||||
*
|
||||
* @return The success state of setting the priority
|
||||
* @param 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 more details.
|
||||
* @return True on success.
|
||||
*/
|
||||
bool SetCurrentThreadPriority(bool realTime, int priority);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user