[wpiutil] DataLog: Ensure file is written on shutdown (#6087)

Previously the thread could end without the file being written.
This commit is contained in:
Peter Johnson
2023-12-23 13:40:51 -08:00
committed by GitHub
parent c29e8c66cf
commit 21d1972d7a
3 changed files with 24 additions and 6 deletions

View File

@@ -486,12 +486,12 @@ class DataLog final {
mutable wpi::mutex m_mutex;
wpi::condition_variable m_cond;
bool m_doFlush{false};
bool m_shutdown{false};
enum State {
kStart,
kActive,
kPaused,
kStopped,
kShutdown,
} m_state = kActive;
double m_period;
std::string m_extraHeader;