[hal] Refactor threads API (#8701)

Since sched_setscheduler() requires non-RT priorities to be 0, we can
use that as a sentinel value for disabling RT and condense the Java API
to just two functions with fewer parameters. The thread priority setter
is deprecated since only experts should use it.

The HAL Notifier thread priority setter was replaced with setting the
priority in the thread itself.

The C++ Notifier non-RT and RT constructors were deduplicated.

The real-time scheduler was changed from SCHED_FIFO to SCHED_RR, which
is SCHED_FIFO with threads allowed to run for a maximum time quantum
before yielding (100 ms by default).
This commit is contained in:
Tyler Veness
2026-04-06 08:49:43 -07:00
committed by GitHub
parent cc56c42d4c
commit 173ecd3d02
27 changed files with 188 additions and 388 deletions

View File

@@ -0,0 +1,6 @@
# Real-time thread priorities
|Name |Location |Priority|
|-------------------|---------------------------------------------------------------------------------------------|--------|
|CAN HAL thread |[hal/src/main/native/systemcore/CAN.cpp](../hal/src/main/native/systemcore/CAN.cpp) |50 |
|Notifier HAL thread|[hal/src/main/native/systemcore/Notifier.cpp](../hal/src/main/native/systemcore/Notifier.cpp)|40 |