mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilibj] Call abort() on Rio on caught Java exception (#6420)
On Rio, we simply want to restart the robot program as quickly as possible, and don't want to risk a hang somewhere that will keep that from happening. The main downside of this is it won't wait for threads to finish (e.g. data logs won't get a final flush).
This commit is contained in:
@@ -453,6 +453,11 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
runRobot(robotSupplier);
|
||||
}
|
||||
|
||||
// On RIO, this will just terminate rather than shutting down cleanly (it's a no-op in sim).
|
||||
// It's not worth the risk of hanging on shutdown when we want the code to restart as quickly
|
||||
// as possible.
|
||||
HAL.terminate();
|
||||
|
||||
HAL.shutdown();
|
||||
|
||||
System.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user