mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Fix ConcurrentModificationException in CommandScheduler (#1938)
This commit is contained in:
@@ -360,6 +360,13 @@ class CommandScheduler final : public frc::Sendable,
|
||||
wpi::SmallVector<Action, 4> m_interruptActions;
|
||||
wpi::SmallVector<Action, 4> m_finishActions;
|
||||
|
||||
// Flag and queues for avoiding concurrent modification if commands are
|
||||
// scheduled/canceled during run
|
||||
|
||||
bool m_inRunLoop = false;
|
||||
wpi::DenseMap<Command*, bool> m_toSchedule;
|
||||
wpi::SmallVector<Command*, 4> m_toCancel;
|
||||
|
||||
friend class CommandTestBase;
|
||||
};
|
||||
} // namespace frc2
|
||||
|
||||
Reference in New Issue
Block a user