From 95fa5ec72ff2f08578c534f7b43d56efe17ac1a9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 10 Nov 2023 21:03:30 -0800 Subject: [PATCH] [wpilibc,ntcoreffi] DataLogManager: join on Stop() call (#5910) This ensures the thread has finished prior to returning from Stop(). --- ntcoreffi/src/main/native/cpp/DataLogManager.cpp | 2 +- wpilibc/src/main/native/cpp/DataLogManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ntcoreffi/src/main/native/cpp/DataLogManager.cpp b/ntcoreffi/src/main/native/cpp/DataLogManager.cpp index e1e49b747b..f81cd6e965 100644 --- a/ntcoreffi/src/main/native/cpp/DataLogManager.cpp +++ b/ntcoreffi/src/main/native/cpp/DataLogManager.cpp @@ -482,7 +482,7 @@ void DataLogManager::Start(std::string_view dir, std::string_view filename, void DataLogManager::Stop() { auto& inst = GetInstance(); inst.owner.GetThread()->m_log.Stop(); - inst.owner.Stop(); + inst.owner.Join(); } void DataLogManager::Log(std::string_view message) { diff --git a/wpilibc/src/main/native/cpp/DataLogManager.cpp b/wpilibc/src/main/native/cpp/DataLogManager.cpp index afe9330daa..f148a62259 100644 --- a/wpilibc/src/main/native/cpp/DataLogManager.cpp +++ b/wpilibc/src/main/native/cpp/DataLogManager.cpp @@ -328,7 +328,7 @@ void DataLogManager::Start(std::string_view dir, std::string_view filename, void DataLogManager::Stop() { auto& inst = GetInstance(); inst.owner.GetThread()->m_log.Stop(); - inst.owner.Stop(); + inst.owner.Join(); } void DataLogManager::Log(std::string_view message) {