Add ability to run robot main loop in a separate thread (#1895)

Default behavior is still to run the robot main loop in the main thread.

The ability to run the robot main loop in a separate thread and add a hook
for running a different function in the main thread is needed for simulation
GUI support on some platforms.
This commit is contained in:
Peter Johnson
2019-09-28 15:43:24 -07:00
committed by GitHub
parent 457f94ba26
commit b23baf611a
12 changed files with 239 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -18,6 +18,12 @@ public final class HAL extends JNIWrapper {
public static native boolean initialize(int timeout, int mode);
public static native boolean hasMain();
public static native void runMain();
public static native void exitMain();
public static native void observeUserProgramStarting();
public static native void observeUserProgramDisabled();