mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal] Add function for changing HAL Notifier thread priority (#3218)
This commit is contained in:
@@ -213,4 +213,21 @@ public class Notifier implements AutoCloseable {
|
||||
m_processLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HAL notifier thread priority.
|
||||
*
|
||||
* <p>The HAL notifier thread is responsible for managing the FPGA's notifier interrupt and waking
|
||||
* up user's Notifiers when it's their time to run. Giving the HAL notifier thread real-time
|
||||
* priority helps ensure the user's real-time Notifiers, if any, are notified to run in a timely
|
||||
* manner.
|
||||
*
|
||||
* @param realTime Set to true to set a real-time priority, false for standard 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.
|
||||
*/
|
||||
public static boolean setHALThreadPriority(boolean realTime, int priority) {
|
||||
return NotifierJNI.setHALThreadPriority(realTime, priority);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user