allow startActivity to be re-entrant with blocking

This commit is contained in:
Jonathan Shook 2023-02-05 20:28:34 -06:00
parent e68e8986b3
commit 4f827c8031

View File

@ -420,7 +420,10 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
}
public synchronized void startActivity() {
// we need an executor service to run motor threads on
RunStateImage startable = tally.awaitNoneOther(1000L, RunState.Uninitialized, RunState.Stopped);
if (startable.isTimeout()) {
throw new RuntimeException("Unable to start activity '" + getActivity().getAlias() + "' which is in state " + startable);
}
startMotorExecutorService();
startRunningActivityThreads();
awaitMotorsAtLeastRunning();