mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +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:
@@ -7,6 +7,7 @@
|
||||
#include <jni.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include <fmt/format.h>
|
||||
@@ -82,6 +83,20 @@ Java_edu_wpi_first_hal_HAL_exitMain
|
||||
HAL_ExitMain();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HAL
|
||||
* Method: terminate
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_HAL_terminate
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
#ifdef __FRC_ROBORIO__
|
||||
std::abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HAL
|
||||
* Method: simPeriodicBeforeNative
|
||||
|
||||
Reference in New Issue
Block a user